2 条题解

  • 0
    @ 2025-8-8 13:40:18
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
       int max=0,q=-1;//你问我为啥要写成-1?我喜欢!
       for(int i=1;i<=56;i++){
          int a;
          cin>>a;
          if(max<a){
             max=a;
             q=i;//位置qwq
          }
       }
       cout<<q<<endl;
       return 0;
    }
    
    • -1
      @ 2025-1-1 18:46:03

      直接暴打 O(1)O(1) awa...

      #include<bits/stdc++.h>
      #define int long long
      #define INF 0x3f3f3f
      using namespace std;
      int mx,ms,x,now=1;
      signed main(){
      	cin>>x;
      	if(x>mx){
      		mx=x;
      		ms=now;
      	}
      	now++;
      	cin>>x;
      	if(x>mx){
      		mx=x;
      		ms=now;
      	}
      	now++;
      	cin>>x;
      	if(x>mx){
      		mx=x;
      		ms=now;
      	}
      	now++;
      	cin>>x;
      	if(x>mx){
      		mx=x;
      		ms=now;
      	}
      	now++;
      	cin>>x;
      	if(x>mx){
      		mx=x;
      		ms=now;
      	}
      	now++;
      	cin>>x;
      	if(x>mx){
      		mx=x;
      		ms=now;
      	}
      	cout<<ms;
      	return 0;
      }
      

      C++:你写个循环会s是吧。。。

      • 1

      信息

      ID
      67
      时间
      1000ms
      内存
      128MiB
      难度
      7
      标签
      递交数
      13
      已通过
      11
      上传者