为什么错?@root

CHY-He 2025-08-31 15:05:25 3

#include <bits/stdc++.h>
using namespace std; int a[100],n=1,cnt=0; int main(){ cin>>a[0]; while(a[n-1]!=0){ cin>>a[n]; n++; } for(int i=0;i<n-1;i++){ for(int j=0;j<n;j++){ if(a[i]*2==a[j]) cnt++; } } cout<<n<<endl; cout<<cnt; return 0; }

{{ vote && vote.total.up }}

共 2 条回复

CHY-He

谢谢

root 站长

输出只有一个