2 条题解

  • 1
    @ 2025-5-25 8:56:24
    #include<bits/stdc++.h>
    using namespace std;
    int n,m;
    int main(){
    	cin>>n;
    	if(n%4==1){
    		cout<<"红色";
    	}
    	if(n%4==2){
    		cout<<"绿色";
    	}
    	if(n%4==3){
    		cout<<"黄色";
    	}
    	if(n%4==0){
    		cout<<"绿色";
    	}
    } 
    

    ??????????????????????

    • 0
      @ 2025-5-26 21:14:16
      #include <iostream>
      #include <algorithm>
      #include <cmath>
      #include <cstdio>
      using namespace std;
      int n;int main() {
      	cin >> n;
      	int l = n % 4;
      	int x;if (l == 1)
      		cout << "红色";
      	else if (l == 2)
      		cout << "蓝色";
      	else if (l == 3)
      		cout << "黄色";
      	else if (l == 0)
      		cout << "绿色";
      }
      
      • 1

      信息

      ID
      503
      时间
      1000ms
      内存
      128MiB
      难度
      10
      标签
      (无)
      递交数
      6
      已通过
      2
      上传者