認真發問

#include <iostream> #include <string.h> using namespace std; int table[2][10]={ {0,1,4,7,6,5,6,3,6,9 }, {0,1,6,3,6,5,6,7,4,9 } }; int main() { int ans,tens,len; char s[200]; while(cin>>s && !(s[0]=='0' && s[1]=='\0') ){ len=strlen(s); if(len>=2){tens=s[len-2]-'0';} else tens=0; ans= tens*47; for(int i=1;i<=s[len-1]-'0';i++){ ans=ans+table[tens%2][i]; } cout<<ans%10<<endl; } return 0; } 明天早餐吃啥? 睡了 晚安
愛心
4
12
全部留言
大一?
笑爛
大一屁孩?
可以不要讓我們大一丟臉?
這則留言已被本人刪除
已經刪除的內容就像 Dcard 一樣,錯過是無法再相見的!
B6
==虧我還很認真看
ಠ_ರೃ秀下限?
B8 我也是很認真的coding solution 能看懂就給你恭喜了 BTW,早餐記得吃
b10中間的for迴看不太懂而已哈哈 早餐吃蜂蜜蛋糕:))
有興趣,有時間的話,可以參考這邊