日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

1100 Mars Numbers (20 分)【难度: 一般 / 知识点: 模拟】

發布時間:2025/3/20 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 1100 Mars Numbers (20 分)【难度: 一般 / 知识点: 模拟】 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.


https://pintia.cn/problem-sets/994805342720868352/problems/994805367156883456
乙級的原題。。

#include<bits/stdc++.h> using namespace std; string a[13]={"tret","jan","feb","mar","apr","may","jun","jly","aug","sep","oct","nov","dec"}; string b[20]={"","tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mer","jou"}; int main(void) {int n; cin>>n;string s; getline(cin,s);while(n--){getline(cin,s); if(s[0]>='0'&&s[0]<='9'){int temp=stoi(s);if(temp<=12) cout<<a[temp]<<endl;else if(temp%13==0) cout<<b[temp/13]<<endl;else cout<<b[temp/13]<<" "<<a[temp%13]<<endl;}else{int sum=0;string x;stringstream l(s);while(l>>x) {for(int i=0;i<13;i++) if(x==a[i]) sum+=i;for(int i=1;i<13;i++) if(x==b[i]) sum+=i*13;}cout<<sum<<endl;}}return 0; }

總結

以上是生活随笔為你收集整理的1100 Mars Numbers (20 分)【难度: 一般 / 知识点: 模拟】的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。