0_0_13599901_15825.cpp:1:4: error: stray '#' in program
01.#include <iostream> 02.using namespace std; 03. 04.int main() 05.{ 06. int a,b,t,i,max; 07. while(cin >> a >> b) 08. { 09. cout << a << " " << b << " "; 10. if(a>b)//大小不确定 11. { 12. t = a; 13. a = b; 14. b = t; 15. } 16. max = 0; 17. for(i = a; i<=b; i++) 18. { 19. int n = i, sum = 1; 20. while(n-1)//等于1时就结束 21. { 22. if(n%2) 23. n = 3*n+1; 24. else 25. n = n/2; 26. sum++; 27. } 28. if(sum>max) 29. max = sum; 30. } 31. cout << max << endl; 32. } 33. 34. return 0; 35.}
^
0_0_13599901_15825.cpp:1:1: error: expected unqualified-id before numeric constant
01.#include <iostream> 02.using namespace std; 03. 04.int main() 05.{ 06. int a,b,t,i,max; 07. while(cin >> a >> b) 08. { 09. cout << a << " " << b << " "; 10. if(a>b)//大小不确定 11. { 12. t = a; 13. a = b; 14. b = t; 15. } 16. max = 0; 17. for(i = a; i<=b; i++) 18. { 19. int n = i, sum = 1; 20. while(n-1)//等于1时就结束 21. { 22. if(n%2) 23. n = 3*n+1; 24. else 25. n = n/2; 26. sum++; 27. } 28. if(sum>max) 29. max = sum; 30. } 31. cout << max << endl; 32. } 33. 34. return 0; 35.}
^
0_0_13599901_15825.cpp:1:51: error: expected unqualified-id before numeric constant
01.#include <iostream> 02.using namespace std; 03. 04.int main() 05.{ 06. int a,b,t,i,max; 07. while(cin >> a >> b) 08. { 09. cout << a << " " << b << " "; 10. if(a>b)//大小不确定 11. { 12. t = a; 13. a = b; 14. b = t; 15. } 16. max = 0; 17. for(i = a; i<=b; i++) 18. { 19. int n = i, sum = 1; 20. while(n-1)//等于1时就结束 21. { 22. if(n%2) 23. n = 3*n+1; 24. else 25. n = n/2; 26. sum++; 27. } 28. if(sum>max) 29. max = sum; 30. } 31. cout << max << endl; 32. } 33. 34. return 0; 35.}
^
|