编写一个程序,输入五个数,输出其中最大的数
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/11 08:38:34
input"请输入第一个数:"toainput"请输入第二个数:"tobinput"请输入第三个数:"toc?"最大值为:",max(a,b,c)
privatesubcommand1_click()dimmaxfori=1to3n=val(inputbox("输入第"&i&"个数"))ifn>maxthenmax=nendifnextprint
参考:http://hi.baidu.com/%D7%F6%B6%F8%C2%DB%B5%C0/blog/item/5522a1674310773caa184c64.html
publicclassMax{publicstaticvoidmain(String[]args){int[]a=newint[5];System.out.println("请输入五个数:");Sca
#include"stdio.h"intmain(){inta,b,num;printf("输入一个两位数");scanf("%d",&num);a=num/10;b=num%10;printf("%
importjava.util.Scanner;publicclassA{//下面的方法是对单个数求阶乘,并返回publicstaticintjieCheng(intn){intsum=1;for(i
voidmain(){inta;scanf("%d",&a);if(a%2==0){printf("偶数");}else{printf("奇数");}}programJO;vara:integer;b
#includeintmain(){intn;scanf("%d",&n);do{printf("%d",n%10);}while(n/=10);printf("\n");return0;}
新鲜出炉的,来吧. class Program {
scanf("%d,%d,%d,&a,&b,&c");改成scanf("%d,%d,%d“,&a,&b,&c);printf("thelargerstnumberis%d\n,max");改成prin
importjava.util.Scanner;publicclassJiecheng{Scannerin=newScanner(System.in);inta=in.nextInt();int
算法分析:把输入的三位数分解(百,十,个);再交换个位和百位就可行了.#include{intn,a,b,c,x;printf("请输入一个三位数:\n");scanf("%d",&n);a=n/10
scanf("%a%b%c",&a,&b,&c);改为,就可以scanf("%lf%lf%lf",&a,&b,&c);
intmain(){intn,n1,n2;cin>>n1;n2=n1%100;n1=n1/100;n=n1;n2=n2%10;n1=n1/10;n=n+10*n1+100*n2;returnn;}
#includemain(){intn,i;inta[10];printf("请输入个数n:");scanf("%d",&n);for(i=0;i=0;i--)printf("%d\t",a[i]);
#include <stdio.h>void main(){ int n,a[100],i,j,temp;\x09scanf("%d&qu
#include <iostream>using namespace std;int main(){int a,b,c,t;cin&nbs
QBINPUTA,B,CMAX=AIFMAX
1.#include#include#definepi3.1415926voidmain(){doublex,y,z;scanf("%lf",&x);if(x>0)y=2*pi*x;z=pi*x*x;
#includevoidmain(){inta,b,d;charc;printf("请输入一种运算符:\n");scanf("%c",&c);printf("请输入两个数:\n");scanf("%d