首页 > 编程语言 > 详细

160809225-叶桦汀《C语言程序设计》实验报告

时间:2016-09-24 23:20:26      阅读:259      评论:0      收藏:0      [点我收藏+]
#include<stdio.h>
int main()
{
    int a,b,c,t;
    printf("请输入三个整数");
    scanf("%d%d%d",&a,&b,&c);
    if(a<b){
        t=a;
        a=b;
        b=t;
        }
  if(b>c)  {
      
  printf("%d\t%d\t%d\n",a,b,c);}
  else if(c<a){
      printf("%d\t%d\t%d\n",c,a,b); }
  else{
      printf("%d\t%d\t%d\n",a,b,c);
  }
  return 0;
  }

技术分享

# include <stdio.h> 
# include <math.h> 
int main(void)
{
   double x, y; 
   printf("输入 x:");
   scanf("%lf", &x); 
   if (x >4){
       y = sqrt(x-4);
   }
   else if (x <-5){
       y =fabs(x);
   }
   else{
      y = x+3;
   }
   printf("结果= %.2f\n",  y);
return 0;
}

技术分享

#include<stdio.h>
int main()
{
   char ch;
   printf("请输入一个字符:\n");
   scanf("%c",&ch);
   printf("其大写字符是:%c\n",ch-32);
}

技术分享

# include <math.h> 
int main(void)
{
   double x, y; 
   printf("输入 x:");
   scanf("%lf", &x); 
   if (x >=10){
       y = (3*x)-11;
   }
   else if (x <1){
       y =x;
   }
   else {
      y = (2*x)-11;
   }
   printf("结果= %.2f\n",  y);
return 0;
}

技术分享

# include <stdio.h> 
int main(){
    int a;
    printf("请输入成绩;");
    while(scanf("%d",&a)   &&  a >= 0  &&  a <= 100)
    if(a>=90)
        {printf("A");}
    else if(a<=89&a>=80){
        printf("B");}
    else if(a<=79&a>=70)
        {printf("C");}
    else if(a<=69&a>=60){
    printf("D");
        }
    else if(a<60){
    printf("E");
        }
}

技术分享

160809225-叶桦汀《C语言程序设计》实验报告

原文:http://www.cnblogs.com/yehuating/p/5904173.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!