想請問各位高手
我現在在解文文出國那題
也就是要算平年或閏年那題
程式是寫好了
但怎麼跑都是CE
而我也看不懂編譯器訊息寫什麼
有人可以看出我的程式碼那裡有問題嗎?
感激不盡!!!
===========================
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include<sstream>
using namespace std;
int main()
{
int n;
string s;
while(cin >> s)
{
n = atoi(s.c_str());
if(n % 4 != 0)
{
cout << "平年" << endl;
}
else
{
if(n % 25 == 0 && n % 16 == 0)
{
cout << "閏年"<< endl;
}
else
{
cout << "平年"<< endl;
}
}
}
return 0;
}
======================
編譯錯誤, 請檢查語法是否符合系統所支援的編譯器的要求。
錯誤訊息:
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
想請問各位高手
我現在在解文文出國那題
也就是要算平年或閏年那題
程式是寫好了
但怎麼跑都是CE
而我也看不懂編譯器訊息寫什麼
有人可以看出我的程式碼那裡有問題嗎?
感激不盡!!!
===========================
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int n;
string s;
while(cin >> s)
{
n = atoi(s.c_str());
if(n % 4 != 0)
{
cout << "平年" << endl;
}
else
{
if(n % 25 == 0 && n % 16 == 0)
{
cout << "閏年"<< endl;
}
else
{
cout << "平年"<< endl;
}
}
}
return 0;
}
======================
編譯錯誤, 請檢查語法是否符合系統所支援的編譯器的要求。
錯誤訊息:
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
裡面有很多不是空白,但是看起來是空白的字元
想請問各位高手
我現在在解文文出國那題
也就是要算平年或閏年那題
程式是寫好了
但怎麼跑都是CE
而我也看不懂編譯器訊息寫什麼
有人可以看出我的程式碼那裡有問題嗎?
感激不盡!!!
===========================
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int n;
string s;
while(cin >> s)
{
n = atoi(s.c_str());
if(n % 4 != 0)
{
cout << "平年" << endl;
}
else
{
if(n % 25 == 0 && n % 16 == 0)
{
cout << "閏年"<< endl;
}
else
{
cout << "平年"<< endl;
}
}
}
return 0;
}
======================
編譯錯誤, 請檢查語法是否符合系統所支援的編譯器的要求。
錯誤訊息:
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\343’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:18: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\343’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
/tmp/code_832737.cpp:20: error: stray ‘\200’ in program
裡面有很多不是空白,但是看起來是空白的字元
我了解了!
感謝指教喔!!!