一条C++编程题目

[复制链接]
查看11 | 回复1 | 2010-3-23 23:02:22 | 显示全部楼层 |阅读模式
#include #include void main(){ char buff[32]; int x; int len; int i; scanf("%d",&x);//输入,比如123 sprintf(buff,"%d",x); len=strlen(buff);//长 printf("len=%d",len); printf("\r\n");//正 printf("%s",buff); printf("\r\n");//逆 for(i=0;i='0'&&input = 0 ; i--){printf("%c",input) ;}
回复

使用道具 举报

千问 | 2010-3-23 23:02:22 | 显示全部楼层
不给代码。那是害你! 首先求他的位数 用foreah比较好吧!并且也可以输出每个整数!再定义一个变量 ,每循环一次 变量++;可以求总共几位! 然后拆分掉!进行逆向输出就行!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行