fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4. int x,y;
  5. cin>>x>>y;
  6. while(x!=0&&y!=0){
  7. if(x>y){
  8. x=x-y;
  9. }else if (x<y){
  10. y=y-x;
  11. }else y=0;
  12. }
  13. cout<<x+y<<endl;
  14. return 0;
  15. }
Time limit exceeded #stdin #stdout 5s 3468KB
stdin
-2
12
stdout
Standard output is empty