题解 | 整型存储

整型存储

https://www.nowcoder.com/practice/5391e3118a5f419d8198264c5a8c805a

#include <iostream>
#include<vector>
using namespace std;

int main() {
    int a, b;
   for(int i=0;i<10;i++){
    scanf("%d",&a);
    if(a==0)break;
    b=a;
    vector<int>vec;
    while(b!=0){
        
        vec.push_back(b%10);
        b=b/10;
    }
    printf("%d ",a);

    for(auto it=vec.begin();it!=vec.end();it++){
       b=10*b+*it;
    }
    printf("%d\n",b);
   }
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

许愿ssp的咸鱼很不想泡池子:import python as pyhton
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务