#10435: c++解答


superbear0418 (bear0418)

學校 : 不指定學校
編號 : 54311
來源 : [61.57.98.63]
最後登入時間 :
2015-11-09 20:38:40
a009. 解碼器 -- ACM 458 | From: [111.243.157.20] | 發表日期 : 2015-11-07 18:37

#include <iostream>

#include <string>

using namespace std;

 

int main()

{

    string a;

    while(getline(cin, a)){

        for ( int i = 0 ; i < a.length() ; i++){

        char ch;

        ch = a[i]-7;

        cout << ch;

        }

        a.clear();

        cout << endl;

    }

 

return 0;

 

 

 

}

 
#10549: Re:c++解答


bobcheng15 (Bobby)

學校 : 桃園市私立復旦高級中學
編號 : 51251
來源 : [118.169.250.126]
最後登入時間 :
2017-08-29 16:32:59
a009. 解碼器 -- ACM 458 | From: [203.71.2.66] | 發表日期 : 2015-12-16 11:43

#include

#include

using namespace std;

 

int main()

{

    string a;

    while(getline(cin, a)){

        for ( int i = 0 ; i < a.length() ; i++){

        char ch;

        ch = a[i]-7;

        cout << ch;

        }

        a.clear();

        cout << endl;

    }

 

return 0;

 

 

 

}

為什麼要加a.clear()? 

 
ZeroJudge Forum