fork(1) download
  1. #include <stdlib.h>
  2. #include <iostream.h>
  3. using namespace std;
  4.  
  5. int OGC(int c,int b,int a)
  6. {
  7. // cout<"c="<<c <<endl;
  8. // cout<"b="<<c <<endl;
  9. // cout<"a="<<c <<endl;
  10. return 2*c*b*a ;
  11.  
  12. }
  13.  
  14.  
  15. //////Master
  16. int main(){
  17. int n;
  18. int a,b,c,d,e;
  19. for(int i=0;i<2;i++){ //外層迴圈
  20. cout<<"the #1:";
  21. cin>>a;
  22. cout<<"the #2:";
  23. cin>>b;
  24. cout<<"the #3:";
  25. cin>>c;
  26. n= OGC(a,b,c) ;
  27. cout << "第"<<i+1<<"圈 n= " <<n<< endl;
  28. }
  29.  
  30. system("Pause");
  31. return 0;
  32.  
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:22: error: iostream.h: No such file or directory
prog.cpp: In function ‘int main()’:
prog.cpp:20: error: ‘cout’ was not declared in this scope
prog.cpp:21: error: ‘cin’ was not declared in this scope
prog.cpp:27: error: ‘endl’ was not declared in this scope
prog.cpp:18: warning: unused variable ‘d’
prog.cpp:18: warning: unused variable ‘e’
prog.cpp:30: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
stdout
Standard output is empty