#21224: C++解答 供參考


rakyjack (WaYe)

學校 : 國立中興大學
編號 : 103345
來源 : [49.217.174.139]
最後登入時間 :
2023-10-22 16:49:22
b428. 凱薩加密 | From: [101.9.181.98] | 發表日期 : 2020-05-03 14:15

#include <iostream>

 

using namespace std;

 

int main(){

    char clearT,cipherT;

    while(cin>>clearT){

        cin.ignore(1000,'\n');

        cin>>cipherT;

        cin.ignore(1000,'\n');

        if(cipherT-clearT<0)

            cout<<int(cipherT-clearT+26)<<endl;

        else

            cout<<int(cipherT-clearT)<<endl;

    }

    return 0;

}

 

 
ZeroJudge Forum