Уборка территории
http://www.e-olimp.com/solutions/54726 I forgot read to A and B but my program passed 53.3%??
> victor > http://www.e-olimp.com/solutions/54726 > > I forgot read to A and B but my program passed 53.3%?? You want to know why your invalid program sometimes gives the correct results?
> MrMozg > You want to know why your invalid program sometimes gives the correct results? Of course
> victor > Of course You know exactly what the initial value will assign a variable the compiler? It would be surprising if the program has given 100% result, there is nothing surprising - rand() is also sometimes gives the correct result.
include <iostream>
using namespace std;
int gcd(int a, int b) { while (b) { a %= b; swap(a, b); } return a; }
int main() { int n, m; cin >> n >> m; if (n == 1 || m == 1) cout << 1 << endl; else cout << gcd(n, m) << endl; }
це габела
це габела
це габела
pRIVET
1000-7
darov
include <iostream>
using namespace std;
int gcd(int a, int b) { while (b) { a %= b; swap(a, b); } return a; }
int main() {
бабл квас