4 条题解

  • 2
    @ 2024-7-27 15:17:23

    #include using namespace std; int main() { int n,a,b,c; cin>>n; a=n/100; b=(n/10)%10; c=n%10; if (a0) { if (b0) cout<<"1\n"<<c; else cout<<"2\n"<<b<<" "<<c;
    } else cout<<"3\n"<<a<<" "<<b<<" "<<c; return 0;
    }

    • 2
      @ 2023-7-27 18:19:09

      #include using namespace std; int main() { int a,b,c,d,e,f; scanf("%d",&a); if(a/10!=0) if(a/100!=0) { c=3;d=a/100;e=a/10%10;f=a%10; printf("%d\n",c); printf("%d %d %d\n",d,e,f); } else { c=2;e=a/10%10;f=a%10; printf("%d\n",c); printf("%d %d\n",e,f); } else { c=1;f=a%10; printf("%d\n",c); printf("%d\n",f);} return 0;

      }

      • 1
        @ 2024-7-29 17:05:54

        #include #include<> using namespace std; int main() { int n,a,b,c,d,e,f; scanf("%d",&n);

        b=n%100; c=b%10; e=(n-b)/100; d=(b-c)/10;

        if(n<10) { f=1; printf("1\n"); cout<<c;

        }

         else if(n<100)
        

        { f=2; printf("2\n"); cout<<d<<" "<<c; }

         else if(n<1000){
         f=3;
        

        printf("3\n"); cout<<e<<" "<<d<<" "<<c; }

        return  0;
        

        }

        • 1
          @ 2024-7-26 17:24:05

          #include<bits/stdc++.h> using namespace std; int main() { int a,b,c,d,e,f; scanf("%d",&a); if(a/10!=0) { if(a/100!=0) { c=3; d=a/100; e=a/10%10; f=a%10; printf("%d\n",c); printf("%d %d %d",d,e,f); } else { c=2; e=a/10%10; f=a%10; printf("%d\n",c); printf("%d %d",e,f); } } else { c=1; f=a%10; printf("%d\n",c); printf("%d",f); } return 0; }

          • 1

          信息

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