tmrd.net
当前位置:首页>>关于编写一个程序,要求输入一个5位数.把该数分解成单独...的资料>>

编写一个程序,要求输入一个5位数.把该数分解成单独...

c: #include "stdio.h" void main() { int a; int a1,a2,a3,a4,a5;//分别存放各个位 printf("输入一个5位的整数:\n"); scanf("%d",&a); printf("输入的数字是:%d\n",a); a5=a%10; a4=(a/10)%10; a3=(a/100)%10; a2=(a/1000)%10; a1=(a/10000)%10...

#include int main(){int n, i, d[5];scanf("%d", &n);d[0] = n / 10000 % 10;d[1] = n / 1000 % 10;d[2] = n / 100 % 10;d[3] = n / 10 % 10;d[4] = n / 1 % 10;printf("%d", d[0]);for (i = 1; i < 5; i++)printf("***%d", d[i]);;return 0;}...

//第一题 123 sum=6 Press any key to continue #include #include main() { int i=0,sum=0; char str[100]="\0"; gets(str); while (str[i]!='\0') sum+=str[i++]-'0'; printf("sum=%d\n",sum); } 第二题 Fklqd Press any key to continue #inc...

import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;//直接控制台输入public class TestBaidu {public static void main(String[] args) throws NumberFormatException,IOException {BufferedReader r...

#include int main(void) { int a,b,c,d,e; long s; printf("请输入一个5位数\n"); scanf("%ld",&s); a = s * 0.0001; b = (s * 0.001) - a * 10; c = (s * 0.01) - (a * 100 + b * 10); d = (s * 0.1) - (a * 1000 + b * 100 + c * 10); e = s ...

#include#include int main(){char a[5];int len = 0, i = 0; scanf("%s",a);len = strlen(a); printf("该数是%d位数,各位数字为:", len);for(; i < len; i++) printf("%c,", a[i]);printf("\b "); return 0; }

public class Test{ public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.println("请输入一个5位数");//控制台输入数字 int c = in.nextInt(); System.out.println((c/1%10)+""+(c/10%10)+""+(c/100%10...

#include main() { int x; char y[4]; cin>>y[0]>>y[1]>>y[2]>>y[3]; x=y[0]+y[1]+y[2]+y[3]-192; cout

望采纳 1.从个位开始输出 #include int main(int argc, char *argv[]) { int a,n; printf("输入一个五位数正整数:"); scanf("%d",&a); while(a>0) {n=a%10; printf("%d\n",n); a=a/10; } return 0; } 2.从最高(万)位开始输出 #include int mai...

public static void main(String[] args) { System.out.println("输入五位数:"); int num=new Scanner(System.in).nextInt(); if (num9999) { if (num / 10000 == num % 10 && num / 1000 % 10 == num / 10 % 10) { System.out.println(num); } ...

网站首页 | 网站地图
All rights reserved Powered by www.tmrd.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com