4 条题解

  • 1
    @ 2024-9-29 23:33:28
    #include <iostream>
    #include <string>
    using namespace std;
    int main(){
    	string a,b;
    	cin >> a >> b;
    	if(a < b)cout << "YES";
    	else cout << "NO";
    	return 0;
    }
    
    • 0
      @ 2024-11-25 19:23:01
      #include <stdio.h>
      int main(){
          char a[10001];
          char b[10001];
          scanf("%s",a);
          scanf("%s",b);
          int i;
          for(i=0;1;i++){
              if(a[i]>b[i]){
                  printf("NO");
                  break;}
              if(a[i]<b[i]){
                  printf("YES");
                  break; } }
          return 0;}
      
      • 0
        @ 2024-10-20 21:52:58

        #include<stdio.h> #include<string.h>

        //挨个比较

        int main() { char str1[10001],str2[10001];// scanf("%s %s",&str1,&str2); int len1=strlen(str1); int len2=strlen(str2); int i=0; while(i<len1&&i<len2) { if(str1[i]<str2[i])//比较长度 { printf("YES\n"); return 0; } else if(str1[i]>str2[i]) { printf("NO\n"); return 0; } i++; } if(len1<len2) { printf("YES\n"); } else { printf("NO\n"); } return 0; }

        • 0
          @ 2023-10-20 20:08:46

          #include <cstdio> #include <iostream> #include <cstring> using namespace std; int main () { char a[10001],b[10001]; //定义可以稍微大一点 cin.getline(a,10001);// cin.getline 适用于带有空格的输入,cin 适用于没有空格的输入 cin.getline(b,10001); if(strcmp(a,b)<0) { printf("YES\n"); } else printf("NO\n"); return 0; }

          ————————————————

          • 1

          信息

          ID
          38
          时间
          1000ms
          内存
          128MiB
          难度
          9
          标签
          递交数
          4405
          已通过
          463
          上传者