-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
111 changed files
with
9,226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* example1-1*/ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
printf("hello world!"); | ||
|
||
return 0; | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* example1-2 */ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
printf(" *\n"); | ||
printf(" ***\n"); | ||
printf(" *****\n"); | ||
printf("*******\n"); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* example103 */ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int data1,data2,data3; | ||
|
||
data1 = 80; | ||
data2 = 80; | ||
data3 = data1 + data2; | ||
|
||
printf("data3 = %d\n",data3); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* example1-4 */ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int a,b,y1,y2,y3,y4;; | ||
|
||
a=12; | ||
b=35; | ||
y1 = a + b; | ||
y2 = a - b; | ||
y3 = a * b; | ||
y4 = a / b; | ||
|
||
printf("y1 = %d\n", y1); | ||
printf("y2 = %d\n", y2); | ||
printf("y3 = %d\n", y3); | ||
printf("y4 = %d\n", y4); | ||
|
||
return 0; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* example1-5 */ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
char a, b, c, d; | ||
|
||
printf("please enter a character: "); | ||
scanf("%c",&c); | ||
a = 'A'; | ||
b = a + 32; | ||
d = 112; | ||
|
||
printf("a = %c, %d\n", a, a); | ||
printf("b = %c, %d\n", b, b); | ||
printf("c = %c, %d\n", c, c); | ||
printf("d = %c, %d\n", d, d); | ||
|
||
return 0; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* example1-6 */ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int a = 9, b = 5; | ||
|
||
printf("%d, %d\n", a, b); | ||
printf("%d, %d\n", a++, b--); | ||
printf("%d, %d\n", ++a, --b); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* example1-7 */ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int a = -1; | ||
unsigned b = 1; | ||
char c = 'A'; | ||
|
||
printf("a = %u, %d, %o, %x\n", a, a, a, a); | ||
printf("b = %u, %d, %o, %x\n", b, b, b, b); | ||
printf("c = %u, %d, %o, %x\n", c, c, c, c); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* example1-8 */ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int a, b, c, d, e, f; | ||
|
||
a = sizeof(int); | ||
b = sizeof(char); | ||
c = sizeof(double); | ||
d = sizeof(short); | ||
e = sizeof(long); | ||
f = sizeof(float); | ||
|
||
printf("%d\n%d\n%d\n%d\n%d\n%d", a, b, c, d, e, f); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* example1-9 */ | ||
#include<stdio.h> | ||
#include<math.h> | ||
|
||
int main(void) | ||
{ | ||
float x, y, dDistance, dAngle; | ||
|
||
printf("ÇëÊäÈëxµÄÖµ:"); | ||
scanf("%f", &x); | ||
printf("ÇëÊäÈëyµÄÖµ:"); | ||
scanf("%f", &y); | ||
|
||
dDistance = sqrt((x * x)+(y * y)); | ||
dAngle = atan(y / x); | ||
|
||
printf("The Distance is:%f\n", dDistance); | ||
printf("The Angle is:%f rad\n", dAngle); | ||
|
||
return 0; | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* example1-10 */ | ||
#include<stdio.h> | ||
#include<math.h> | ||
#define PI 3.1415 | ||
|
||
int main(void) | ||
{ | ||
float r, fArea; | ||
printf("请输入半径:"); | ||
scanf("%f", &r); | ||
|
||
fArea = PI * r * r; | ||
|
||
printf("圆的面积为:%f", fArea); | ||
|
||
return 0; | ||
} | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* */ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//*********************************************** | ||
//File name:0201 | ||
//Author:ŔîşĆČť | ||
//Date:2019.10.20 | ||
//Student ID:2019218211 | ||
//*********************************************** | ||
#include<stdio.h> | ||
#include<math.h> | ||
|
||
int main(void) | ||
{ | ||
float a, b, c, q, fArea; | ||
printf("please input triangles side:\n"); | ||
scanf("%f%f%f", &a, &b, &c); | ||
|
||
q = (a + b + c) *0.5; | ||
fArea = sqrt(q * (q - a) * (q - b) * (q - c)); | ||
|
||
printf("The area is:%.2f", fArea); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//*********************************************** | ||
//File name:0202 | ||
//Author:ÀîºÆÈ» | ||
//Date:2019.10.20 | ||
//Student ID:2019218211 | ||
//*********************************************** | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
float a, b, c, fVolume; | ||
printf("Please input long,weight,high:\n"); | ||
scanf("%f%f%f", &a, &b, &c); | ||
|
||
fVolume = a * b * c; | ||
|
||
printf("The volume is:%.2f", fVolume); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//*********************************************** | ||
//File name:0203 | ||
//Author:ÀîºÆÈ» | ||
//Date:2019.10.20 | ||
//Student ID:2019218211 | ||
//*********************************************** | ||
#include<stdio.h> | ||
#define PI 3.14159 | ||
int main(void) | ||
{ | ||
float r, h, fVolume; | ||
printf("please input r,h:\n"); | ||
scanf("%f%f", &r, &h); | ||
|
||
fVolume = (PI * r * r * h)/3; | ||
|
||
printf("The volume is:%f", fVolume); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//*********************************************** | ||
//File name:0204 | ||
//Author:李浩然 | ||
//Date:2019.10.20 | ||
//Student ID:2019218211 | ||
//*********************************************** | ||
#include<stdio.h> | ||
#define PI 3.14159 | ||
|
||
int main(void) | ||
{ | ||
float fAngle, r, fArea; | ||
printf("请输入度数和半径:"); | ||
scanf("%f%f", &fAngle, &r); | ||
|
||
fArea = (fAngle / 360) * PI * r * r; | ||
|
||
printf("扇形的面积是:%f", fArea); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//*********************************************** | ||
//File name:0205 | ||
//Author:李浩然 | ||
//Date:2019.10.20 | ||
//Student ID:2019218211 | ||
//*********************************************** | ||
#include<stdio.h> | ||
#include<math.h> | ||
|
||
int main(void) | ||
{ | ||
float x, y, z, fDistance; | ||
float a, b, c; | ||
printf("请输入x,y,z:"); | ||
scanf("%f%f%f", &x, &y, &z); | ||
|
||
fDistance = sqrt(x * x + y * y + z * z); | ||
a = acos(x/fDistance); | ||
b = acos(y/fDistance); | ||
c = acos(z/fDistance); | ||
|
||
printf("到原点的距离 = %f", fDistance); | ||
printf("与x轴的夹角= %f", a); | ||
printf("与y轴的夹角= %f", b); | ||
printf("与z轴的夹角= %f", c); | ||
|
||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//*********************************************** | ||
//File name:0206 | ||
//Author:李浩然 | ||
//Date:2019.10.20 | ||
//Student ID:2019218211 | ||
//*********************************************** | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
float a, b, c, d, fAverange; | ||
printf("请输入四科成绩:\n"); | ||
scanf("%f%f%f%f", &a, &b, &c, &d); | ||
|
||
fAverange = (a + b + c + d)/4; | ||
|
||
printf("四科成绩的平均值是:%.2f", fAverange); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//*********************************************** | ||
//File name:0207 | ||
//Author:李浩然 | ||
//Date:2019.10.20 | ||
//Student ID:2019218211 | ||
//*********************************************** | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int a; | ||
printf("请输入0~9中的任意一位数字:"); | ||
scanf("%d", &a); | ||
a = a + 32; | ||
printf("它对应的ASCII码是:%d", a); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//*********************************************** | ||
//File name:0208 | ||
//Author:李浩然 | ||
//Date:2019.10.20 | ||
//Student ID:2019218211 | ||
//*********************************************** | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
char a, b; | ||
printf("请输入大写字母:"); | ||
scanf("%c", &a); | ||
|
||
b = a + 32; | ||
|
||
printf("它的小写字母是:%c\n", b); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.