#45946: c++最佳解(或許吧)


s310488@student.cysh.cy.edu.tw (umbrella1788)

School : 國立嘉義高級中學
ID : 282305
IP address : [163.27.3.92]
Last Login :
2025-06-06 10:13:48
a065. 提款卡密碼 -- 板橋高中教學題 | From: [163.27.3.92] | Post Date : 2025-05-02 11:13

利用字元距離計算

#include <bits/stdc++.h>
using namespace std;

int main(){
    string m;
    cin >> m;
    for(int i=1;i<7;i++){
        cout << abs(m[i]-m[i-1]);
    }
}

 
ZeroJudge Forum