| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 81976 | sh25_shenpy | 罗马数字 | C++ | 解答错误 | 1 MS | 248 KB | 547 | 2026-01-09 17:07:18 |
#include<bits/stdc++.h> #include<cstring> using namespace std; int main(){ string s; int n,m=0; cin>>n; for(int i=0;i<n;++i){ cin>>s; for(int j=0;j<s.size();++j){ if(s[j]=='I') ++m; else if(s[j]=='V') m+=5; else if(s[j]=='X') m+=10; else if(s[j]=='L') m+=50; else if(s[j]=='C') m+=100; else if(s[j]=='D') m+=500; else m+=1e3; } cout<<m<<endl; m=0; } return 0; }