include<stdio.h>int main(){int a = 12345, b = 0;while (a != 0){b = b * 10 + a % 10;a /= 10;}printf("%d\n", b);return 0;}
//#include "stdafx.h"//If the vc++6.0, with this line.#include "stdio.h"int func(int n,int x=0){ if(n){ (x*=10)+=n%10; return func(n/10,x); } return x;}int main(void){//测试一下…… printf("%d\n",func(12345)); return 0;} ...
using System.Text;namespace myperoject512 { class Program { static void Main(string[] args){ int i = 12345, j = 0;string stemp = "";string temp = i.ToString();char[] ctemp = temp.ToCharArray();for (int z = ctemp.Length - 1; z >= 0; z--){ stemp = stemp +...
int main(){ int a=12345,b=0; for(;a>0;) { b+=a%10; a/=10; b*=10; } b/=10; printf("%d\n",b); return 0;} 殇之赞歌 毛蛋 1 2楼我不会!楼主你没设变量i1,i2等,你就用,你说可以么?我菜鸟 509537115 毛蛋 1
10eb 这样不行,10e4这样可以。b是变量不能作次方