Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
61620 | 王一涵(吃土豆长大的马铃薯) | 小明三年身高 | C++ | 通过 | 0 MS | 240 KB | 340 | 2025-03-06 16:52:31 |
#include<bits/stdc++.h> using namespace std; int main() { int heights[3]; int year; for(int i=0;i<3;i++){ cin>>heights[i]; } cin>>year; int index=year-2000; cout<<heights[index]<<endl; if(year==2000){ cout<<"0"<<endl; }else{ int growth=heights[index]-heights[index-1]; cout<<growth<<endl; } return 0; }