我从简单到难,一起走上漫漫刷题路!
爱你们,我会持续在我的博客中更新我每天刷题的内容!
相互交流,爱你们哦!
大家一键三连,多多关注,爱你们哦!
这是今天我给大家带来的题!以后难度逐渐加深!
1.小飞机
int main(){ printf(" ** \n"); printf(" ** \n"); printf("************\n"); printf("************\n"); printf(" * * \n"); printf(" * * \n"); return 0; }
2.你是天才吗
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> int main() { int a; scanf("%d", &a); if (a >= 140) printf("Genius"); return 0; }
3.输出学生信息
#include<stdio.h> int main(){ printf("Name Age Gender\n"); for(int i = 0;i<21;i++) { printf("-"); } printf("\n"); printf("Jack 18 man\n"); return 0; }
注意这里的姓名,年龄和性别都要一一对应第一行每个空四格但是第三行年龄和性别间要空五格才对应
4.发出信息
#include<iostream> using namespace std; int main() { cout<<"I lost my cellphone!"; }
5.实践出真知
#include <stdio.h> int main() { printf("Practice makes perfect"); return 0; }
6.大V
#include<stdio.h> int main() { int i, j; for (i = 0; i <= 2; i++) { for (j = 0; j <= 4; j++) { if (j == i) printf("v"); else if (j + i == 4) printf("v"); else printf(" "); } printf("\n"); } return 0; }
7.有容乃大
#include<stdio.h> int main(int argc,char *argv[]){ printf("The size of short is %d bytes.\n",sizeof(short)); printf("The size of int is %d bytes.\n",sizeof(int)); printf("The size of long is %d bytes.\n",sizeof(long)); printf("The size of long long is %d bytes.\n",sizeof(long long)); return 0; }
8.缩短二进制
#include <iostream> using namespace std; int main(){ int x = 1234; printf("%#o %#X", x, x); return 0; }
9.十六进制转十进制
#include <stdio.h> int main() { printf("%15d",0xABCDEF); return 0; }
10.printf的返回值
#include<stdio.h> int main() { printf("\n%d", printf("Hello world!")); return 0; }