编程C语言程序,实现如下功能:从键盘任意输入3个整数,求出3个数中的 用C编写一个程序,从键盘输入3个整数,计算并输出3个数的和、...
\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f,\u5b9e\u73b0\u5982\u4e0b\u529f\u80fd,\u4ece\u952e\u76d8\u4e0a\u8f93\u5165\u4efb\u610f3\u4e2a\u6b63\u6574\u6570,\u5e76\u6c42\u51fa\u5b83\u4eec\u7684\u6700\u5927\u503c#include
void main()
{
here:
char h;
int i ;
float tmp[3];
int a[3];
printf("\u8bf7\u8f93\u5165\u4e09\u4e2a\u6b63\u6574\u6570\uff1a\n");
for(i=0;i<=2;){
scanf("%f",&tmp[i]);
if((tmp[i]-(int)tmp[i])!=0){
printf("\u8f93\u5165\u7684\u975e\u6b63\u6574\u6570\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff1a");
}
else{
a[i]=tmp[i];
i++;
}
}
i=(a[0]>a[1]?a[0]:a[1])>a[2]?(a[0]>a[1]?a[0]:a[1]):a[2];
printf("\u6700\u5927\u503c\u4e3a\uff1a%d",i);
printf("\u662f\u5426\u9000\u51fa\uff1fy/n\n");
there:
scanf(" %c",&h);
if(h=='y'||h=='Y')
return;
else if(h=='n'||h=='N')
goto here;
else
printf("\u8f93\u5165\u6709\u8bef\uff01\u8bf7\u91cd\u65b0\u8f93\u5165\uff1a");
goto there;
}
C\u8bed\u8a00\u7a0b\u5e8f\u3002
\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e86\u5427\uff1a
#includevoid main(){int a,b,c,s,j;scanf("%d%d%d",&a,&b,&c);/*\u8bfb\u5165\u4e09\u4e2a\u6570*/s=a+b+c;j=a*b*c;/*\u8ba1\u7b97\u5b83\u4eec\u7684\u548c\u3001\u79ef*/printf("%d %d\n",s,j);/*\u8f93\u51fa*/ }\u8fd0\u884c\u4e00\u4e0b\u5c31\u53ef\u4ee5\u4e86\u3002
using namespace std;
int main()
{
int a,b,c;
int max;
cout<<"请输入三个数";
cin>>a>>b>>c;
if(a>b)
{
max = b;
if(c > max)
max = c;
}
else
{
max = a;
if(c > max)
max = c;
}
cout<<"最大值是"<<c<<endl;
return 0;
}
绛旓細using namespace std;int main(){ int a,b,c;int max;cout<<"璇疯緭鍏ヤ笁涓暟";cin>>a>>b>>c;if(a>b){ max = b;if(c > max)max = c;} else { max = a;if(c > max)max = c;} cout<<"鏈澶у兼槸"<<c<<endl;return 0;} ...
绛旓細int y,m,d,c,s,w; printf("璇疯緭鍏8浣嶅勾鏈堟棩,浠ョ┖鏍奸殧寮:"); scanf("%d%d%d",&y,&m,&d); if (m==1) c=d; else if (m==2) c=31 d; else if (m==3) c=31 28 d; else if (m==4) c=31 28 31 d; else if (m==5) c=31 28 31 30 d; else if (m==6) c=31 28...
绛旓細=0||year%400==0;}int get_days(int year,int month,int day){//杩斿洖浠庡叕鍏1骞1鏈1鏃ュ埌璇ユ棩鏈熺殑澶╂暟 int i; int sum=0; for(i=1; i<year; i++) { if(leap_year(i)) sum+=366; else sum+=365; } if(leap_year(year)) Month[2]=29; ...
绛旓細浣犲ソ 璇︾粏浠g爜濡備笅锛include<stdio.h> define MAX 100 int main(){ int a[MAX];int n,i,j,temp;printf("璇疯緭鍏ユ暟缁勭殑鍏冪礌涓暟:");scanf("%d",&n);printf("璇疯緭鍏ユ暟缁勭殑鍚勪釜鍏冪礌(鐢,闅斿紑)\n:");for(i=0;i<n;i++){ if(i==n-1){ scanf("%d",&a[i]);continue;} scanf("%...
绛旓細C璇█瀹炵幇杈撳叆1鍒7鐨勬暟瀛,杈撳嚭瀵瑰簲鏄槦鏈熷嚑,鍙傝冧唬鐮濡備笅: #include "stdio.h" int main() { int d; const char wd[7][3]= {"涓","浜","涓","鍥","浜","鍏","鏃"}; scanf("%d",&d); printf("鏄熸湡%s",wd[d-1]); return 0; } 鏈洖绛旇缃戝弸閲囩撼 宸茶禐杩 宸茶俯杩< 浣犲杩欎釜鍥炵瓟鐨...
绛旓細void main (){ int y,m,d,c,s,w;printf("璇疯緭鍏8浣嶅勾鏈堟棩,浠ョ┖鏍奸殧寮锛");scanf("%d%d%d",&y,&m,&d);if (m==1) c=d;else if (m==2) c=31+d;else if (m==3) c=31+28+d;else if (m==4) c=31+28+31+d;else if (m==5) c=31+28+31+30+d;else if (m...
绛旓細unsigned int id;char name[NAME_MAX_LEN+1];unsigned int score;} student;int main (int argc, char** argv) { char* path;FILE * fp;student top_student = {0}, tmp = {0}, pool_student = {0};int total_score, student_number;if (argc < 2) { return 0;} path = argv...
绛旓細include "stdio.h"void main(){ int n,sum=0;printf("璇疯緭鍏ヤ竴涓笁浣嶆暟锛");scanf("%d",&n);sum=n/100+n%100/10+n%10;//鐧句綅鏁+鍗佷綅鏁+涓綅鏁 printf("杩欎釜涓変綅鏁板悇浣嶆暟瀛椾箣鍜屾槸%d\n",sum);} 缁撴灉锛
绛旓細include<stdio.h> main(){ char x,y,z;scanf("%c,%c,%c",&x,&y,&z);x+=32;y+=32;z+=32;printf("%c,%c,%c",x,y,z);}
绛旓細include <stdio.h>#include <stdlib.h>int main(){ int i,j; scanf("%d %d",&i,&j); printf("%d\n",i<j?i:j); return 0;}杈撳叆鏃惰浣跨敤绌虹櫧瀛楃鍒嗗紑锛屾瘮濡1 3锛屾垨鑰1鍥炶溅锛2鍥炶溅銆傚鏋滄兂杈撳叆1锛3锛岃鏇存敼scanf("%d,%d",&i,&j);