pascal输入一组数,将其中最大值与最小值对调
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/31 17:32:11
programex1;varn,a,b,i,j,gongyueshu,gongbeishu:longint;beginreadln(a,b);if(a1和
看vari,j,n,t:longint;a:array[1..1000]oflongint;beginwhilenoteolndobegininc(n);read(a[n]);end;i:=1;j:=
/***以下我觉得自己算写得比较好的了.你可以输入任意多个字符,而且有非数字字符等各种错误输入也不会影响统计.希望对你有所帮助.**//*****输入一组数,统计奇数和偶数的个数.**/#includ
测试通过请采纳!#include <iostream>#include <string>#include <vector>using&
var a:array[1..5,1..5] of integer; i,j,max,ij,x,y:integer;begi
vari,k,n1,n2:integer;beginn1:=0;n2:=0;fori:=1to20dobeginreadln(k);ifk>0thenn1:=n1+1elseifk
vari,n,m,max,min:longint;beginreadln(n);max:=-maxlongint;min:=maxlonint;//初始化fori:=1tondobeginreadln
programysh(input,output);varst:ansistring;i,max,min:longint;a:array[1..1000]oflongint;beginreadln(st
varn,s,m:longint;beginread(n);s:=0;m:=0;whilen-1dobeginifnmod2=0thenbegins:=s+n;m:=m+1;end;read(n);e
1.读入a[1~10]2.max=a[1]3.for(i=1;i再问:a[1~10]是什么意思?for(i=1;i
#include <stdio.h>int main(){ int n=10;  
vara,n,i:longint;beginfori:=1to10dobeginread(a);ifa>0thenn:=n+1;end;write(n);end.
varm,n,a,b,r:integer;beginreadln(a,b);m:=a;n:=b;r:=mmodn;whiler0dobeginm:=n;n:=r;r:=mmodn;end;writel
varn:longint;beginreadln(n);writeln(abs(n));{绝对值}writeln(sqr(n));{平方}writeln(sqrt(n));{平方根}writeln(p
#include<stdio.h>int main(void){int n=10,m,i,j,a[10];for(i=0;i<n;i++)scanf(&q
varn,i,j,k:integer;beginreadln(n);fori:=1tondobeginforj:=1to3dobeginwrite('':n-i+1);fork:=1toi+i-1do
varc1,c2,c3:char;a,b,c:0..9;functionv(c:char):0..9;vari:integer;beginval(c,v,i);end;procedurep(a,b,c
#includevoidmain(){inta,b,c;scanf("%d%d%d",&a,&b,&c);printf("%d\n",a>b?((a>c)?(a):(c)):(b>c)?b:c);}再
printf("请输入十个正整数:\");x=(int*)array;for(i=0;iscanf("%d",&j);j=j>0?j:-j;/*保证输入为正整数*/if(maxif(min>j){/*