#include <stdio.h> int main(void) { printf("Hello, World!"); return 0; }
#include <stdio.h> int main(void) { int a, b, c; scanf("%d%d%d", &a, &b, &c); printf("%d", b); return 0; }
#include <stdio.h> int main(void) { int a, b, c; scanf("%d%d%d", &a, &b, &c); printf("%8d %8d %8d", a, b, c);/* 注意輸出的格式 */ return 0; }
#include <stdio.h> int main(void) { float num; scanf("%f", &num); printf("%.3f", num);/* 注意輸出的格式 */ return 0; }
#include <stdio.h> int main(void) { double num; scanf("%lf", &num); printf("%.12f", num);/* 注意輸出的格式 */ return 0; }
#include<stdio.h> int main(void) { char ch; int a; float b; double c; scanf("%c%d%f%lf", &ch, &a, &b, &c); printf("%c %d %.6f %.6lf", ch, a, b, c); return 0; }
#include<stdio.h> int main(void) { double num; scanf("%lf", &num); printf("%f\n%.5f\n%e\n%g", num, num, num, num);/* \n是回車換行符,將當前位置移到下一行開頭 */ return 0; }
#include<stdio.h> int main(void) { char ch; scanf("%c", &ch); /* 輸出空格來代替空白 */ printf(" %c \n", ch); printf(" %c%c%c \n", ch, ch, ch); printf("%c%c%c%c%c\n", ch, ch, ch, ch, ch); return 0; }
#include<stdio.h> int main(void) { char ch; scanf("%c", &ch); /* 輸出空格來代替空白 */ printf(" %c \n", ch); printf(" %c%c%c \n", ch, ch, ch); printf("%c%c%c%c%c\n", ch, ch, ch, ch, ch); printf(" %c%c%c \n", ch, ch, ch); printf(" %c \n", ch); return 0; }
這道題。。。直接輸出就能夠了。。。。code
#include<stdio.h> int main(void) { printf(" ********\n"); printf(" ************\n"); printf(" ####....#.\n"); printf(" #..###.....##....\n"); printf(" ###.......###### ### ### ### ###\n"); printf(" ........... #...# #...# #...# #...#\n"); printf(" ##*####### #.#.# #.#.# #.#.# #.#.#\n"); printf(" ####*******###### #.#.# #.#.# #.#.# #.#.#\n"); printf(" ...#***.****.*###.... #...# #...# #...# #...#\n"); printf(" ....**********##..... ### ### ### ###\n"); printf(" ....**** *****....\n"); printf(" #### ####\n"); printf(" ###### ######\n"); printf("############################################################## ##################################\n"); printf("#...#......#.##...#......#.##...#......#.##------------------# #...#......#.##------------------#\n"); printf("###########################################------------------# ###############------------------#\n"); printf("#..#....#....##..#....#....##..#....#....##################### #..#....#....#####################\n"); printf("########################################## #----------# ############## #----------#\n"); printf("#.....#......##.....#......##.....#......# #----------# #.....#......# #----------#\n"); printf("########################################## #----------# ############## #----------#\n"); printf("#.#..#....#..##.#..#....#..##.#..#....#..# #----------# #.#..#....#..# #----------#\n"); printf("########################################## ############ ############## ############\n"); return 0; }
該博客僅供參考遊戲