wfyj.net
当前位置:首页 >> C语言编程题目 >>

C语言编程题目

#include int main(void) {int y;if(scanf("%d",&y)==1){if(y

#include int cacu(int a,int b){ //此函数传入分子a和分母b,返回最大公约数 int temp; while(b!=0) { temp=a%b; a=b; b=temp; } return a;}int main(){ int a, b; scanf("%d/%d", &a, &b); int c = cacu(a,b); a /= c; b /= c; printf("%d/%d\n...

所求的条件表达式为: a+b>c&&a+c>b&&b+c>a

#include #indefine PI 3.14 int main() { float r; printf("请输入半径:\n"); scanf("%f",&r); printf("此圆的面积是:\n"); printf("%5.2f",PI*r*r); } c语言 C语言是一种计算机程序设计语言,它既具有高级语言的特点,又具有汇编语言的特点...

#include int main(){float A,B,compete,standard;printf("Input percent of A and B:");scanf("%f%f",&A,&B);compete=A*10+B*6;standard=A*8+B*10;printf("compete = %.4f\nstandard = %.4f\n",compete,standard);if(compete

#include void main() { double danjia,huokuan; int shuliang; printf("请输入数量和单价"); scanf("%d,%lf",shuliang,danjia); if(shuliang>=0&&shuliang=50&&shuliang=100&&shuliang=300&&shuliang

一、注意除数不能为0 二、注意要先将被除数乘以1.0 输出时,结果按%lf输出 如: int a, b ; scanf("%d %d", &a,&b ); if ( b==0 ) { printf("除数不能为0!\n"); } else { printf("a / b = %lf\n", a*1.0/b ); }

#includeint main(){int max,min,score;double avg=0;scanf("%d",&score);max=min=score;avg+=score;for(int i=0; imax) max=score;if(score

#include #include void sum(char *sum, char *a, char *b){char *s_short, *s_long;int i_short, i_long, i_result;i_short = strlen(a) - 1;i_long = strlen(b) - 1;if(i_long >= i_short ){s_short = a;s_long = b;i_result = i_long + 1;}el...

#include int main(){ int t,w,h; t=w=h=0; printf("请输入身高体重:\n"); scanf("%d %d",&h,&w); t=w/(h*h); if(t>=27) puts("肥胖"); else if(t>=25) puts("超重体重"); else if(t>=18) puts("正常体重"); else puts("低体重"); return 0;}

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