2014-11-16から1日間の記事一覧

10008 - A / B Problem

#include <cstdio> #include <iostream> using namespace std; void Slove(int a, int b) { printf ( "%d %d %.5lf\n", a/b, a%b, a/(double)b ); } int main(void) { int a, b; cin >> a >> b; Slove(a,b); return 0; } coutで決められた小数点の出し方が分からなかったので、</iostream></cstdio>…

10007 - Swapping Two Numbers

#include <algorithm> #include <iostream> using namespace std; void Slove(int x, int y) { if (x > y) swap(x,y); cout << x << " " << y << endl; } int main(void) { int x, y; while ( cin >> x >> y && (x || y) ) Slove(x,y); return 0; } swap()使いたかっただけ。。</iostream></algorithm>

10006 - Print Test Cases

#include <iostream> using namespace std; int Slove(int n, int i) { cout << "Case " << i << ": " << n << endl; return 1; } int main(void) { int n, i=1; while (cin >> n && n) i+=Slove(n,i); return 0; } やるだけです!!!</iostream>

10005 - Print Many Hello World

#include <iostream> using namespace std; void Slove(void) { for (int i=0; i<1000; ++i) cout << "Hello World" << endl; } int main(void) { Slove(); return 0; } や...る...だ...け...</iostream>

10004 - Sorting Three Numbers

#include <algorithm> #include <iostream> using namespace std; void Slove(void) { int data[3]; for (int i=0; i<3; ++i) cin >> data[i]; sort(data,data+3); for (int i=0; i<3; ++i) (i==0)? cout << data[i] : cout << " " << data[i]; cout << endl; } int main(void) { </iostream></algorithm>…

10003 - Small, Large, or Equal

#include <iostream> using namespace std; void Slove(int a, int b) { if (a > b) cout << "a > b" << endl; else if (a < b) cout << "a < b" << endl; else cout << "a == b" << endl; } int main(void) { int a, b; cin >> a >> b; Slove(a,b); return 0; } やる</iostream>…

10002 - Rectangle

#include <iostream> using namespace std; void Slove(int a, int b) { cout << a*b << " " << 2*(a+b) << endl; } int main(void) { int a, b; cin >> a >> b; Slove(a,b); return 0; } やるだけ!</iostream>

10001 - X Cubic

#include <iostream> using namespace std; void Slove(int x) { cout << x*x*x << endl; } int main(void) { int x; cin >> x; Slove(x); return 0; } やるだけ問題。。</iostream>

10000 - Hello World

#include <iostream> using namespace std; void Slove(void) { cout << "Hello World" << endl; } int main(void) { Slove(); return 0; } やるだけ。。</iostream>