5 条题解

  • 1
    @ 2025-11-7 19:08:30

    包AC

    #include<bits/stdc++.h>
    using namespace std;
    int n,m,a[100000],i; 
    int main(){
    	cin >> n;
    	    while (n){
    		    a[++i]=n%8;
    		    n/=8;
    	    }
    	    for(int j=i; j>=1; j--){
    		    cout << a[j];
    	    }	
    	return 0;
    }
    
    • 0
      @ 2025-12-20 10:52:05

      包AC的

      #include<bits/stdc++.h>
      using namespace std;
      const int N=1e3+10;
      int main()
      {
          int s[N];
          int a;
          int i=0;
          cin>>a;
          int b=0;
          while(a!=0){
          	s[i]=a%8;
          	a/=8;
          	i++;
          	b++;
      	}
      	for(i=b-1;i>=0;i--){
      		cout<<s[i];
      	}
      	return 0;
      }
      
      
      • 0
        @ 2025-11-6 20:49:22

        #include<bits/stdc++.h> using namespace std; const int N=1e5; int n,a[100000],i; int main(){ cin>>n; while(n){ a[++i]=n%8; n/=8; } for(int j=i;j>=1;j--){ cout<<a[j]; }

        }

        • 0
          @ 2024-10-27 21:25:36
          #include<bits/stdc++.h>
          using namespace std;
          int main(){
          	int x,a[105],s=1,i;
          	cin>>x;
          	while(x){
          		a[s++]=x%8;
          		x/=8;
          	}
          	for(i=s-1;i>=1;i--)cout<<a[i];
          	return 0;
          }
          
          • 0
            @ 2023-6-6 18:14:07
            #include <iostream>
            #include <stack>
            using namespace std;
            int main()
            {
                int num;
                cin >> num;
                stack<int> s;
                while (num)
                {
                    s.push(num % 8);
                    num /= 8;
                }
                if (s.empty())
                {
                    cout << 0;
                }
                while (!s.empty())
                {
                    cout << s.top();
                    s.pop();
                }
                return 0;
            }
            
            • 1

            信息

            ID
            1211
            时间
            1000ms
            内存
            128MiB
            难度
            3
            标签
            递交数
            220
            已通过
            119
            上传者