Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
58882 | lixinyu | 小明十年身高 | C++ | Accepted | 0 MS | 240 KB | 320 | 2024-12-20 14:39:00 |
#include<bits/stdc++.h> using namespace std; int main() { int a[10],year;//数组声明 for(int i=0;i<10;i++){//一维数组的输入 cin>>a[i]; } cin>>year; if(year==2000){ cout<<a[0]<<endl; cout<<0; return 0; } int k=year-2000; cout<<a[k]<<endl; cout<<a[k]-a[k-1]; return 0; }