Posted by: dzikrina on: October 29, 2010
//checking phytagoras rectangle #include #include #include using namespace std; int main() { int input[3]; int sum, C; while (cin >> input[0] >> input[1] >> input[2]) { if ( (input[0]== 0) && (input[1] == 0) && (input[2]== 0)) break; sort( input, input+3 ); sum = ( (input[0]*input[0])+(input[1]*input[1])); C = (input[2]*input[2]); if ( sum == C) cout [...]
Posted by: dzikrina on: October 23, 2010
//http://uva.onlinejudge.org/external/113/11388.html //http://github.com/andmej/acm/tree/master/11388%20-%20GCD%20LCM //11388 PROBLEM d: gcd lcm #include using namespace std; int main() { int t; unsigned int g, l; cin >> t; while (t–) { cin >> g >> l; if ( g > l || l % g != 0) cout << "-1" << endl; else cout << g << " " << [...]
Posted by: dzikrina on: October 23, 2010
//http://uva.onlinejudge.org/external/116/11636.html // 11636 Hello World! #include #include using namespace std; int main() { int mycase=0, N; double k; while (1) { cin >> N; if (N <0) break; k = ceil(log(N)/log(2)); int i=0; mycase ++; cout <<"Case " << mycase << ": " << k << endl; } return 0; }
Recent Comments