5 条题解

  • 2
    @ 2022-7-9 10:39:53

    /crl(陈儒乐)/

    #include<bits/stdc++.h>//网上查到的万能头//
    
    using namespace std;
    
    	int main()
    
    {
    
    	int a,b,c;
    
    	cin >> a >> b >> c;
    
    	int f = 1;
    
    	for(int i = 3; i <= 1e6 ; i++)
    
    	{
    
    		if(i%3 == a && i%5 == b && i %7 == c)
    
    		{
    
    			f = 0;
    
    			cout << i << endl;
    
    			break;
    
    		}
    
    	}
    
    	if(f)
    
    		cout << "no answer\n";
    
    }
    
    • @ 2022-12-22 12:54:31

      简化版:

      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int a,b,c;
      	cin >>a>>b>>c;
      	for(int i=3;i<=1e6;i++){
      		if(i%3==a&&i%5==b&&i%7==c){
      			cout<<i<<endl;
      			return 0;
      		}
      	}
      	cout<<"no answer\n";
      }
      
  • 1
    @ 2022-10-25 18:57:31
    #include <iostream>
    #include <stack>
    #include <cmath>
    #include <vector>
    #include <string.h>
    #include <queue>
    #include <stdio.h>
    #include <iomanip>
    #include <cstdio>
    #include <algorithm>
    #define int long long
    using namespace std;
    const int N = 1e5 + 10;
    const int INF = 0x3f3f3f3f;
    signed main()
    {
    	int a, b, c;
    	cin >> a >> b >> c;
    	int num = 3;
    	while(num % 3 != a || num % 5 != b || num % 7 != c)
    	{
    		num++;
    	}
    	cout << num << endl;
    	return 0;
    }
    
    • 1
      @ 2022-3-8 22:22:01

      #include <stdio.h> int main(void) { int t, r, d, l;

      scanf("%d%d%d", &t, &r, &d);
      
      for (l = 11; l < 100000000; l++)
      {
      	if (l % 3 == t && l % 5 == r && l % 7 == d)
      	{
      		printf("%d", l);
      		break;
      	}
      }
      
      if (l + 1 == 100000000)
      {
      	printf("no answer\n");
      }
      
      return 0;
      

      }

      • 0
        @ 2024-6-13 13:54:44

        include<bits/stdc++.h>//空行 using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; for(int i=3;i<=1e6;i++){ if(i%3a and i%5b and i%7==c){ cout<<i<<endl; return 0; } } cout<<"no answer"; } //dongliyang6666666666666666666skhjkfgjgkjhfgjDV

        • 0
          #include <iostream>
          #include <bits/stdc++.h>
          using namespace std;
          const int N=32000+10;
          const int INF=0x3f3f3f3f;
          int t3,t5,t7;
          int main()
          {
          	cin>>t3>>t5>>t7;
          	for(int i=t7;i<=7000;i+=7)
          	{
          		if(i%3==t3 && i%5==t5 && i>=3)
          		{
          			cout<<i;
          			return 0;
          		}
          	}
          	cout<<"no answer";
          	return 0;
          }
          
          
          • 1

          信息

          ID
          910
          时间
          1000ms
          内存
          128MiB
          难度
          5
          标签
          递交数
          596
          已通过
          208
          上传者