🌈 style:

This commit is contained in:
lzy
2024-05-26 15:39:14 +08:00
parent 6f28a3384a
commit a57bbdb4c1
156 changed files with 765 additions and 770 deletions

View File

@@ -1,10 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
int main()
int main( )
{
int ch;
ch = getchar();
ch = getchar( );
putchar(ch);
exit(0);

View File

@@ -3,7 +3,7 @@
#define STRSIZE 32
int main()
int main( )
{
char str[STRSIZE];
gets(str);

View File

@@ -8,7 +8,7 @@
#define STRSIZE 10
int main()
int main( )
{
// printf("hello world\n");
@@ -16,17 +16,16 @@ int main()
// printf("%c\n", ch);
// out: A
int i = 255;
float f = 123.45678;
char str[STRSIZE] = "helloworld";
double dou = 123.456;
long long l = 123456;
int i = 255;
float f = 123.45678;
char str[STRSIZE] = "helloworld";
double dou = 123.456;
long long l = 123456;
// 不加\nbefore while()存入了缓冲区,故不输出
// printf("[%s:%d]before while().", __FUNCTION__, __LINE__);
printf("[%s:%d]before while().\n", __FUNCTION__, __LINE__);
while (1)
{
}
{}
// printf("[%s:%d]after while().", __FUNCTION__, __LINE__);
printf("[%s:%d]after while().\n", __FUNCTION__, __LINE__);
// printf("f = %8.1f\n", f);

View File

@@ -12,13 +12,13 @@
// 但是这时候运行输入hello不会报错
// 实际上是越界了
int main()
int main( )
{
int i;
int i;
float f;
char str[STRSIZE];
int ret;
char ch;
char str[STRSIZE];
int ret;
char ch;
printf("Please enter:\n");

View File

@@ -1,9 +1,9 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define WEIGHT 3.0e-23
#define KQ 950
#define KQ 950
static void water(void)
{
@@ -69,8 +69,8 @@ void root(void)
exit(1);
}
disc = b * b - 4 * a * c;
p = -b / 2 * a;
q = sqrt(disc) / 2 * a;
p = -b / 2 * a;
q = sqrt(disc) / 2 * a;
x1 = p + q;
x2 = p - q;
@@ -79,13 +79,13 @@ void root(void)
printf("x2 = %f\n", x2);
}
int main()
int main( )
{
// water();
// area();
root();
root( );
exit(0);
}