3 条题解

  • 1
    @ 2025-10-13 20:48:33

    AC code:

    #include<queue>
    #include<math.h>
    #include<stdio.h>
    #include<iostream>
    #include<vector>
    #include<iomanip>
    #include<string.h>
    #include<algorithm>
    #include<cmath>
    #include<cstdio>
    #include<utility>
    #include<cstring>
    #include<stack>
    #include<fstream>
    #include<string>
    using namespace std;
    typedef long long ll;
    const int MAX_N = 1e4 + 10;
    const int INF = 0x3f3f3f3f;
    string n[MAX_N];
    string s = "01234567";
    long long a , b , c , d , e , f , g;
    int main()
    {
    	cin >> a;
    	while ( a > 0 )
    	{
    		n[++b] = s[ a % 8 ];
    		a /= 8;
    	}
    	for ( int i = b ; i >= 1 ; i-- )
    	{
    		cout << n[i]; 
    	} 
    	return 0;
    }
    

    请点赞再走😂

    • -1
      @ 2023-6-9 21:54:06
      #include<iostream>
      using namespace std;
      int main()
      {
       	int num,b=1;
       	cin>>num;
       	if(num==0)
       	cout<<num;
      	while(1)
      	{ 
        		if(num>=b)
       	{
        		b*=8;
         		continue;   
       	}
        		b/=8;
        		if(b==0)
        		break;    
        		cout<<num/b;
        		if(num>=b)
        			num%=b;
      	}
      }
      
      • -1
        @ 2023-4-16 8:03:41

        #include<bits/stdc++.h> using namespace std; int main(){ long long res=0,w=0; cin>>res; int a[100]; do{ a[w]=res%8; res=res/8; w++; }while(res>0); for(int i=w-1;i>=0;i--){ cout<<a[i]; } return 0; }

        • 1

        信息

        ID
        1874
        时间
        1000ms
        内存
        256MiB
        难度
        5
        标签
        (无)
        递交数
        191
        已通过
        70
        上传者