迴圈

輸入字串

輸出前後項差距

 

#include <iostream>
#include <cmath>

 

 

using namespace std;

int main()
{
    string str;
    while(cin >> str)
    {
        for(int i= 0; i<6; i++)
            cout << abs(str[i+1] - str[i]);
        cout << endl;
    }

    return 0;
}
 

 
arrow
arrow
    全站熱搜

    大神(偽) 發表在 痞客邦 留言(0) 人氣()