首页 > 其他分享 >实验1

实验1

时间:2023-10-06 22:33:50浏览次数:30  
标签:11 10 13 12 int 实验 printf

1 // 打印一个字符小人
 2 
 3 #include <stdio.h>
 4 int main()
 5 {
 6     printf(" o \n");
 7     printf("<H>\n");
 8     printf("I I\n");
 9     printf(" o \n");
10     printf("<H>\n");
11     printf("I I\n");
12 
13     return 0;
14  } 
1 // 打印一个字符小人
 2 
 3 #include <stdio.h>
 4 int main()
 5 {
 6     printf(" o     o \n");
 7     printf("<H>   <H>\n");
 8     printf("I I   I I\n");
 9 
10     return 0;
11  } 

 1 1 //从键盘上输入三个数据作为三角形边长,判断其能否构成三角形
 2  2 //构成三角形的条件 :任意两边之和大于第三边
 3  3 
 4  4 #include <stdio.h>
 5  5 
 6  6 int main()
 7  7 {
 8  8     float a, b, c;
 9  9     
10 10     //输入三边边长
11 11     scanf("%f %f %f",&a,&b,&c)
12 12     ;
13 13     
14 14     //判断能否构成三角形
15 15     if((a+b>c)&&(a+c>b)&&(b+c>a)) 
16 16        printf("能构成三角形\n");
17 17     else
18 18        printf("不能构成三角形\n");
19 19        
20 20        return 0;
21 21  } 

 

 1 1 #include <stdio.h>
 2  2 
 3  3 int main()
 4  4 {
 5  5     double x, y;
 6  6     char c1, c2, c3;
 7  7     int a1, a2, a3;
 8  8     
 9  9     scanf("%d %d %d",&a1, &a2, &a3);
10 10     printf("a1 = %d, a2 = %d, a3 = %d\n",a1,a2,a3);
11 11     
12 12     scanf("%c %c %c", &c1,&c2,&c3);
13 13     printf("c1 = %c,c2 = %c,c3 = %c\n",c1,c2,c3);
14 14     
15 15     scanf("%lf %lf",&x,&y);
16 16     printf("x = %lf, y = %lf\n",x, y);
17 17     
18 18        return 0;
19 19 }

 1 1 #include <stdio.h>
 2  2 
 3  3 int main()
 4  4 {
 5  5     int year;
 6  6     
 7  7     int x=1000000000;
 8  8     year=x/60/60/24/365;
 9  9     
10 10     printf("10亿秒等于%d\n年",year);
11 11     
12 12        return 0;
13 13 }

 1  1 #include <stdio.h>
 2  2 #include <math.h>
 3  3 
 4  4 int main()
 5  5 {
 6  6     double x, ans;
 7  7     
 8  8     scanf("%lf",&x);
 9  9     ans = pow(x, 365);
10 10     printf("%.2f的365次方:%.2f\n", x, ans);
11 11     
12 12        return 0;
13 13 }
 1 1 #include <stdio.h>
 2  2 #include <math.h>
 3  3 
 4  4 int main()
 5  5 {
 6  6     double x, ans;
 7  7     
 8  8     while(scanf("%lf",&x) != EOF)
 9  9     {ans = pow(x, 365);
10 10     printf("%.2f的365次方:%.2f\n", x, ans);
11 11     printf("\n")
12 12     }
13 13     
14 14     
15 15     
16 16        return 0;
17 17 }

 

标签:11,10,13,12,int,实验,printf
From: https://www.cnblogs.com/daiyifei/p/17745203.html

相关文章

  • 实验1
    实验1#include<stdio.h>intmain(){printf("0\n");printf("<H>\n");printf("II\n");printf("0\n");printf("<H>\n");printf("II\n");re......
  • 实验1
    一)code11#include<stdio.h>2intmain()3{4printf("O\n");5printf("<H>\n");6printf("II\n");7printf("O\n");8printf("<H>\n");9printf("II\n");......
  • 实验1C语言输入输出和简单程序编写
    实验任务1task1.c源代码:1//打印一个字符小人23#include<stdio.h>4intmain()5{6printf("0\n");7printf("<H>\n");8printf("II\n");91011return0;12} 运行截图:task1_1.c源代......
  • 实验1
    实验1实验一源码#include<stdio.h>intmain(){printf("O\n");printf("<H>\n");printf("II\n");return0;}实验一结果实验1.1源码#include<stdio.h>intmain(){printf("O\n"......
  • 实验一
    实验一代码1结果1   代码2  结果2 实验二代码结果实验三代码 结果实验四代码结果实验五代码 #include<stdio.h>intmain(){ intyear; doubles; s=1000000000; year=s/60/60/24/365+0.5; printf("等于%d年\n",year); retu......
  • 实验1 C语言输入输出和简单程序编写
    一1_1.c1#include<stdio.h>23intmain()4{5printf("o\n");6printf("<H>\n");7printf("II\n");8printf("o\n");9printf("<H>\n");10......
  • 实验1
    一.实验任务11.11#include<stdio.h>2intmain()3{4printf("O\n");5printf("<H>\n");6printf("II\n");78return0;9}截图11.21#include<stdio.h>2intmain()3{4printf("O......
  • 实验1 C语言输入输出和简单程序编写
    实验1实验1-11//打印一个字符小人23#include<stdio.h>4intmain()5{6printf("O\n");7printf("<H>\n");8printf("II\n");9printf("O\n");10printf("<H>\......
  • 实验一
    实验一task1-1.c1#include<stdio.h>2intmain()3{4printf("O\n");5printf("<H>\n");6printf("II\n");7printf("O\n");8printf("<H>\n");9printf("II\n&quo......
  • 实验1
    实验任务11#include<stdio.h>2intmain()3{4printf("o\n");5printf("<H>\n");6printf("II\n");78return0;910}运行结果task1_1task1_2实验任务21#include<......