Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
835 曾浩森 22相差2的数的个数 C++ Wrong Answer 0 MS 256 KB 358 2023-04-15 14:55:51

Tests(0/2):


Code:

#include<iostream> using namespace std; int main(){ int a,b[100],c=1,d=0; cin>>a; for(int i=0;i<=a-1;i++){ cin>>b[i]; } for(int j=0;j<=a;j++){ for(int i=1;i<=a;i++){ if(b[j]-b[i]==1||b[0]-b[i]==2){ c++; } } if(c>d){ d=c; } c=0; } cout<<c; }


Run Info:

------Input------
10 80 79 78 77 65 55 54 54 50 49
------Answer-----
3
------Your output-----
0