fork download
  1. int main(){
  2. int n;
  3. int a,b,c,d,e;
  4. for(int i=0;i<2;i++){ //外層迴圈
  5. cout<<"the #1:";
  6. cin>>a;
  7. cout<<"the #2:";
  8. cin>>b;
  9. cout<<"the #3:";
  10. cin>>c;
  11. }
  12. n=a+b+c;//將n丟到function A
  13.  
  14. function_A(n,.....);
  15.  
  16. cout<<"the #4:";
  17. cin>>d;
  18. cout<<"the #5:";
  19. cin>>e;
  20. //d和e 丟到function B
  21.  
  22. for(int j=0;j<2;j++){ //內層迴圈
  23. function_B(d,e,....);
  24. }
  25. }
  26.  
  27. //如果迴圈數少 還可以手動輸入
  28. //如果迴圈數百來次 那就要按上百次
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:5: error: ‘cout’ was not declared in this scope
prog.cpp:6: error: ‘cin’ was not declared in this scope
prog.cpp:14: error: expected primary-expression before ‘...’ token
prog.cpp:14: error: ‘function_A’ was not declared in this scope
prog.cpp:16: error: ‘cout’ was not declared in this scope
prog.cpp:17: error: ‘cin’ was not declared in this scope
prog.cpp:23: error: expected primary-expression before ‘...’ token
prog.cpp:23: error: ‘function_B’ was not declared in this scope
stdout
Standard output is empty