【入门1】顺序结构
#include<stdio.h>
int main(){
printf("Hello,World!");
return 0;
}
#include <stdio.h>
int main(){
printf(" * \n");
printf(" *** \n");
printf("***** \n");
printf(" *** \n");
printf(" * \n");
return 0;
}
#include<stdio.h>
int main() {
printf(
" ********\n"
" ************\n"
" ####....#.\n"
" #..###.....##....\n"
" ###.......###### ### ###\n"
" ........... #...# #...#\n"
" ##*####### #.#.# #.#.#\n"
" ####*******###### #.#.# #.#.#\n"
" ...#***.****.*###.... #...# #...#\n"
" ....**********##..... ### ###\n"
" ....**** *****....\n"
" #### ####\n"
" ###### ######\n"
"##############################################################\n"
"#...#......#.##...#......#.##...#......#.##------------------#\n"
"###########################################------------------#\n"
"#..#....#....##..#....#....##..#....#....#####################\n"
"########################################## #----------#\n"
"#.....#......##.....#......##.....#......# #----------#\n"
"########################################## #----------#\n"
"#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n"
"########################################## ############\n"
);
return 0;
}
#include<stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
printf("%d",(a+b));
return 0;
}
#include <stdio.h>
int main()
{
char c = getchar();
printf(" %c\n %c%c%c\n%c%c%c%c%c\n", c,c,c,c,c,c,c,c,c);
return 0;
}
#include<stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
printf("%d",a*b);
return 0;
}
#include<stdio.h>
int main(){
putchar(getchar()-32);
return 0;
}
#include <stdio.h>
#include <string.h>
int main() {
char s[20];
scanf("%s", s);
int len = strlen(s);
for (int i = len - 1; i >= 0; i--) {
printf("%c", s[i]);
}
printf("\n");
return 0;
}
#include<stdio.h>
int main(){
int a;
float t;
scanf("%f%d",&t,&a);
printf("%.3f\n",t/a);
printf("%d",a*2);
return 0;
}
#include<stdio.h>
#include<math.h>
int main(){
double a,b,c,p;
scanf("%d%d%d",&a,&b,&c);
p = (a+b+c)/2;
printf("%.1f",sqrt(p*(p-a)*(p-b)*(p-c)));
return 0;
}
#include<stdio.h>
int main(){
double h0,r0,sum;
scanf("%lf%lf",&h0,&r0);
double h=h0*0.1;
double r=r0*0.1;
double v=3.14*r*r*h;
int i = 1;
while (1){
sum=v*i;
if(20<=sum){
printf("%d",i);
break;
}
else{
i++;
}
}
return 0;
}
#include<stdio.h>
int main(){
double a,b,c;
scanf("%lf%lf%lf",&a,&b,&c);
printf("%.0lf",a*0.2+b*0.3+c*0.5);
return 0;
}
#include<stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
printf("%d",(a*10+b)/19);
return 0;
}
#include<stdio.h>
int main(){
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
int begin =a*60+b;
int end = c*60+d;
int time =end - begin;
printf("%d %d",time/60,time%60);
return 0;
}
标签:main,return,入门,int,洛谷题,scanf,C语言,printf,include
From: https://www.cnblogs.com/lehi520/p/18537898