任意输入一个4位自然数,调用函数输出它的各位数字组成的最大
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/11 01:22:09
解决的办法很多.楼主想用程序的办法来解决吗?我写个伪代码给你参考下.i=1while(n/10>0){i=i+1n=n/10}printi这里算出来的i就是n的位数.如果有什么不明白了,再问:我说说我
#includevoidmain(){intn,m;scanf("%d",&n);while(n){m=n%10;//取末位的数字printf("%d",m);n/=10;//去掉末位}printf(
intmain(){intn,n1,n2,n3,n4;cin>>n;n1=n/1000;n2=(n%1000)/100;n3=(n%100)/10;n4=n%10;n=n1+10*n2+100*n3+
#include <stdio.h>float sum1(int n);float sum2(int n);void main(
#includevoidsx(intx[],intn){inti,j,t;for(i=0;i
#include<stdio.h>int getmax(int a,int b){ re
#includeintmain(){intn;scanf("%d",&n);do{printf("%d",n%10);}while(n/=10);printf("\n");return0;}
团队俊狼猎英#includeusingnamespacestd;intmain(){inta[10];inti,j;intb,k=100000;cin>>b;for(i=1;i再问:这个程序有好多错误
x=""@2,10say"输入任意一个正整数"getxpicture"999999999999999"readlx=len(alltrim(x))lx=alltrim(str(lx))@4,14say
#include#includedoublefun1(doublen){doublesum=0;doublem=0;for(inti=2;inum;if(num%2==0){cout
dimrassingle,sassingler=inputbox("请输入圆的半径:")s=3.14159*r^2print"圆的面积是:";s
n=val(thisform.text1.value)s=0fori=1tons=s+1/inextthisform.text2.value=str(s,10,3)再问:再问:这个嘞?
intmain(intargc,char*argv[]){inti=0,j,tmp;intarr[4]={0};scanf("%d",&j);printf("yourinputwas:%d\n\n",
#include#includeintmain(void){\x09chara[20];\x09printf("请输入数字");\x09scanf("%s",a);\x09printf("%c",a[
#includevoidmain(){inta,b,num1,num2,temp;scanf("%d%d",&num1,&num2);if(num1
#includemain(){longintn,i,j,k;doublem;printf("请输入数字'n':");scanf("%d",&n);if(n%2==1){for(i=0;i0){for(
什么事指针函数?不知道这个但是完成上面的题貌似很简单
#include<stdio.h>voidfunc(intarray[4][4]){ inttemp=0; inti,j; for(i=0;i<4;i+
#includeintGcd(intM,intN){intRem;while(N>0){Rem=M%N;M=N;N=Rem;}returnM;}voidmain(){inta,b