2014-11-01から1ヶ月間の記事一覧

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>

0093 - Leap Year

#include <iostream> using namespace std; bool Leap_Year(int year) { return ( ( !(year%400) || (!(year%4) && year%100) )? true : false ); } void Slove(int a, int b) { bool flg=false; for (int year=a; year<=b; ++year) if ( Leap_Year(year) ) { flg=true</iostream>…

0092 - Square Searching

#include <algorithm> #include <iostream> using namespace std; int dp[1000+1][1000+1]; void Init(int n) { for (int i=0; i<=n; ++i) for (int j=0; j<=n; ++j) dp[i][j]=0; } void Slove(int n) { int answer=0; char field[n+1][n+1]; Init(n); for (int i=1; i<=n; ++i) f</iostream></algorithm>…

0086 - Patrol

#include <iostream> using namespace std; void Slove(void) { int a, b; while (cin >> a >> b) { int graph[100]={0}; while ( !(!a && !b) ) { ++graph[--a]; ++graph[--b]; cin >> a >> b; } bool flg=true; if ( !(graph[1]%2) || !(graph[1]%2) ) flg=false; fo</iostream>…