Skip to content

Commit e7d844c

Browse files
committed
use pure c instead of cpp
1 parent eee847a commit e7d844c

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

c/rainbowBomb/main.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include <stdio.h>
2+
#include <stdbool.h>
3+
int bomb(int times,char Char){
4+
printf("%c[47;31m",0x1B);
5+
while (times>0){
6+
putchar(Char);
7+
times--;
8+
}
9+
printf("%c[0m\n",0x1B);
10+
}
11+
int main(int argc,char *argv[]){
12+
char Char;
13+
if (1 == argc){
14+
Char='~';
15+
printf("plz input a char:");
16+
Char = getchar();
17+
}else
18+
{
19+
Char = argv[1][0];
20+
}
21+
while (true) {
22+
bomb(8,Char);
23+
bomb(9,Char);
24+
bomb(10,Char);
25+
bomb(11,Char);
26+
bomb(10,Char);
27+
bomb(9,Char);
28+
bomb(8,Char);
29+
30+
}
31+
}

c/rainbowBomb/main.cpp

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)