#34806: 新手解


b109101@ctes.ylc.edu.tw (Asuka)

學校 : 不指定學校
編號 : 194767
來源 : [1.168.55.231]
最後登入時間 :
2024-01-08 14:34:32
k181. 我愛 88 大回饋 -- 板橋高中教學題 | From: [114.38.161.114] | 發表日期 : 2023-04-18 12:19

#include <iostream>
using namespace std;
int main()
{
    string str;
    int ans=0;
    cin>>str;
    for(int i=0;i<str.size();i++){
        cout<<str[i];
        if(str[i]=='8')ans+=10;
    }
    cout<<" can get "<<ans<<"% off.\n";
    return 0;
}

 
ZeroJudge Forum