fork download
  1. # include <iostream>
  2. using namespace std;
  3.  
  4. int main {
  5. int minMN = 0, maxMN = 0, threeRaiseMin = 1, twoRaiseMax = 1;
  6. int m, n, i, j;
  7. cout << "give m and n:" <<
  8. cin >>m>>n;
  9. for(i = m, j = n; ((i >= 0)||(j >= 0)); i--, j--){
  10. if((i >= 1)&&(j >= 1)){
  11. minMN++;
  12. threeRaiseMin *= 3;
  13. }
  14. maxMN++;
  15. twoRaiseMax *=2;
  16. }
  17. return 0;
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
5
3
compilation info
prog.cpp:4:5: error: cannot declare ‘::main’ to be a global variable
 int main {
     ^~~~
prog.cpp:5:3: error: expected primary-expression before ‘int’
   int minMN = 0, maxMN = 0, threeRaiseMin = 1, twoRaiseMax = 1;
   ^~~
prog.cpp:5:3: error: expected ‘}’ before ‘int’
prog.cpp:7:3: error: ‘cout’ does not name a type
   cout << "give m and n:" <<
   ^~~~
prog.cpp:9:3: error: expected unqualified-id before ‘for’
   for(i = m, j = n; ((i >= 0)||(j >= 0)); i--, j--){
   ^~~
prog.cpp:9:25: error: expected ‘)’ before ‘>=’ token
   for(i = m, j = n; ((i >= 0)||(j >= 0)); i--, j--){
                         ^~
prog.cpp:9:25: error: expected ‘)’ before ‘>=’ token
prog.cpp:9:43: error: ‘i’ does not name a type
   for(i = m, j = n; ((i >= 0)||(j >= 0)); i--, j--){
                                           ^
prog.cpp:17:3: error: expected unqualified-id before ‘return’
   return 0;
   ^~~~~~
prog.cpp:18:1: error: expected declaration before ‘}’ token
 }
 ^
stdout
Standard output is empty