fork(1) download
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4.  
  5. int NWD(int a, int b)
  6. {
  7. if(b!=0)
  8. return NWD(b,a%b);
  9.  
  10. return a;
  11. }
  12.  
  13. int main()
  14. {
  15. int a, b;
  16.  
  17. cout<<"Podaj dwie liczby: ";
  18. cin>>a>>b;
  19.  
  20. cout<<"NWD("<<a<<","<<b<<") = "<<NWD(a,b)<<endl;
  21.  
  22. system("pause");
  23. return 0;
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:1: error: class, interface, or enum expected
#include<iostream>
        ^
Main.java:2: error: illegal character: '#'
#include<cstdlib>
^
Main.java:5: error: class, interface, or enum expected
int NWD(int a, int b)
^
Main.java:10: error: class, interface, or enum expected
    return a;
    ^
Main.java:11: error: class, interface, or enum expected
}
^
Main.java:17: error: class, interface, or enum expected
    cout<<"Podaj dwie liczby: ";
    ^
Main.java:18: error: class, interface, or enum expected
    cin>>a>>b;
    ^
Main.java:20: error: class, interface, or enum expected
    cout<<"NWD("<<a<<","<<b<<") = "<<NWD(a,b)<<endl;
    ^
Main.java:22: error: class, interface, or enum expected
    system("pause");
    ^
Main.java:23: error: class, interface, or enum expected
    return 0;
    ^
Main.java:24: error: class, interface, or enum expected
}
^
12 errors
stdout
Standard output is empty