fork download
  1. #include <iostream>>
  2. using namespace std;
  3. int main () {
  4. int a,b,h=0;
  5. cin>>a>>b;
  6. h=a;
  7. if (h<b || h==0) { cout<<h; system ("pause"); return 0; }
  8. else {
  9. while (a>=b) {
  10. h+=a/b; a=(a%b)+(a/b);
  11. }
  12. }
  13. cout <<h;
  14.  
  15. system("pause");
  16.  
  17. return 0;
  18. }
  19.  
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:20: warning: extra tokens at end of #include directive [enabled by default]
 #include <iostream>>
                    ^
prog.cpp: In function ‘int main()’:
prog.cpp:7:48: error: ‘system’ was not declared in this scope
     if (h<b || h==0) { cout<<h; system ("pause"); return 0; }    
                                                ^
prog.cpp:15:19: error: ‘system’ was not declared in this scope
     system("pause"); 
                   ^
stdout
Standard output is empty