/Anonimizzato6604Utente anonimizzato27 ott 2009, 22:12Io scrivo: int a,b; cin>>a>>b; int mcd(int a, int b) {int resto; while (b!=0) {resto=a%b; a=b; b=resto; } return a; } e mi dice: <a function-definition is not allowed here before '{' token> <expected `,' or `;' before '{' token> che devo fare??
/Anonimizzato6541Utente anonimizzato27 ott 2009, 23:01Ma... cosa hai scritto?! #include <iostream> int mcd(int a, int b) { int t; while (b!=0){ t=b; b=a % b; a=t; } return a; } main () { int a,b; std::cin>>a>>b; a=mcd(a,b); std::cout<<a; }