forked from Mzzopublic/C
-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 0780421
Showing
557 changed files
with
57,059 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,22 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
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,163 @@ | ||
################# | ||
## Eclipse | ||
################# | ||
|
||
*.pydevproject | ||
.project | ||
.metadata | ||
bin/ | ||
tmp/ | ||
*.tmp | ||
*.bak | ||
*.swp | ||
*~.nib | ||
local.properties | ||
.classpath | ||
.settings/ | ||
.loadpath | ||
|
||
# External tool builders | ||
.externalToolBuilders/ | ||
|
||
# Locally stored "Eclipse launch configurations" | ||
*.launch | ||
|
||
# CDT-specific | ||
.cproject | ||
|
||
# PDT-specific | ||
.buildpath | ||
|
||
|
||
################# | ||
## Visual Studio | ||
################# | ||
|
||
## Ignore Visual Studio temporary files, build results, and | ||
## files generated by popular Visual Studio add-ons. | ||
|
||
# User-specific files | ||
*.suo | ||
*.user | ||
*.sln.docstates | ||
|
||
# Build results | ||
[Dd]ebug/ | ||
[Rr]elease/ | ||
*_i.c | ||
*_p.c | ||
*.ilk | ||
*.meta | ||
*.obj | ||
*.pch | ||
*.pdb | ||
*.pgc | ||
*.pgd | ||
*.rsp | ||
*.sbr | ||
*.tlb | ||
*.tli | ||
*.tlh | ||
*.tmp | ||
*.vspscc | ||
.builds | ||
*.dotCover | ||
|
||
## TODO: If you have NuGet Package Restore enabled, uncomment this | ||
#packages/ | ||
|
||
# Visual C++ cache files | ||
ipch/ | ||
*.aps | ||
*.ncb | ||
*.opensdf | ||
*.sdf | ||
|
||
# Visual Studio profiler | ||
*.psess | ||
*.vsp | ||
|
||
# ReSharper is a .NET coding add-in | ||
_ReSharper* | ||
|
||
# Installshield output folder | ||
[Ee]xpress | ||
|
||
# DocProject is a documentation generator add-in | ||
DocProject/buildhelp/ | ||
DocProject/Help/*.HxT | ||
DocProject/Help/*.HxC | ||
DocProject/Help/*.hhc | ||
DocProject/Help/*.hhk | ||
DocProject/Help/*.hhp | ||
DocProject/Help/Html2 | ||
DocProject/Help/html | ||
|
||
# Click-Once directory | ||
publish | ||
|
||
# Others | ||
[Bb]in | ||
[Oo]bj | ||
sql | ||
TestResults | ||
*.Cache | ||
ClientBin | ||
stylecop.* | ||
~$* | ||
*.dbmdl | ||
Generated_Code #added for RIA/Silverlight projects | ||
|
||
# Backup & report files from converting an old project file to a newer | ||
# Visual Studio version. Backup files are not needed, because we have git ;-) | ||
_UpgradeReport_Files/ | ||
Backup*/ | ||
UpgradeLog*.XML | ||
|
||
|
||
|
||
############ | ||
## Windows | ||
############ | ||
|
||
# Windows image file caches | ||
Thumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
|
||
############# | ||
## Python | ||
############# | ||
|
||
*.py[co] | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
|
||
#Translations | ||
*.mo | ||
|
||
#Mr Developer | ||
.mr.developer.cfg | ||
|
||
# Mac crap | ||
.DS_Store |
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,6 @@ | ||
/* The first C programme */ | ||
#include <stdio.h> /* 包含标准输入输出头文件 */ | ||
main() /* 主函数 */ | ||
{ | ||
printf("Hello World!\n"); /* 打印输出信息 */ | ||
} |
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 @@ | ||
0 |
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,6 @@ | ||
#include "print.h" | ||
|
||
int main(void){ | ||
printHello(); | ||
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,6 @@ | ||
#include "print.h" | ||
|
||
void printHello() | ||
{ | ||
printf("hello word!\n"); | ||
} |
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,3 @@ | ||
#include "stdio.h" | ||
|
||
void printHello(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,10 @@ | ||
/* Input two numbers, output the product */ | ||
#include <stdio.h> | ||
main() | ||
{ | ||
int x,y,m; /* 定义整型变量x,y,m */ | ||
printf("Please input x and y\n"); /* 输出提示信息 */ | ||
scanf("%d%d",&x,&y); /* 读入两个乘数,赋给x,y变量 */ | ||
m=x*y; /* 计算两个乘数的积,赋给变量m */ | ||
printf("%d * %d = %d\n",x,y,m); /* 输出结果 */ | ||
} |
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 @@ | ||
0 |
Binary file not shown.
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,11 @@ | ||
/* 输入两个浮点数,输出它们中的大数 */ | ||
#include <stdio.h> | ||
main() | ||
{ | ||
float x,y,c; /* 变量定义 */ | ||
printf("Please input x and y:\n"); /* 提示用户输入数据 */ | ||
scanf("%f%f",&x,&y); | ||
c=x>y?x:y; /* 计算c=max(x,y) */ | ||
printf("MAX of (%f,%f) is %f",x,y,c); /* 输出c */ | ||
} | ||
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,28 @@ | ||
/* */ | ||
#include <stdio.h> | ||
main() | ||
{ | ||
char ch,nch; /* */ | ||
int count; /* */ | ||
int k; /* */ | ||
|
||
printf("Please input a string with a # in the end.\n"); | ||
scanf("%c",&ch); /* */ | ||
while(ch != '#') /* */ | ||
{ | ||
if(ch >= '0' && ch <= '9') | ||
{ | ||
/* */ | ||
count = ch-'0'+1; /* */ | ||
scanf("%c",&nch); /* */ | ||
for(k=0;k<count;k++) /* */ | ||
printf("%c",nch); | ||
} | ||
else | ||
printf("%c",ch); /* */ | ||
printf(" "); /* */ | ||
scanf("%c",&ch); /* */ | ||
} | ||
printf("#\n"); /* */ | ||
} | ||
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,28 @@ | ||
/* 输出不同类型所占的字节数*/ | ||
#include <stdio.h> | ||
void main() | ||
{ | ||
/* sizeof()是保留字,它的作用是求某类型或某变量类型的字节数, */ | ||
/* 括号中可以是类型保留字或变量。*/ | ||
/*int型在不同的机器,不同的编译器中的字节数不一样,*/ | ||
/*一般来说在TC2.0编译器中字节数为2,在VC编译器中字节数为4 */ | ||
printf("The bytes of the variables are:\n"); | ||
printf("int:%d bytes\n",sizeof(int)); | ||
/* char型的字节数为1 */ | ||
printf("char:%d byte\n",sizeof(char)); | ||
/* short型的字节数为2 */ | ||
printf("short:%d bytes\n",sizeof(short)); | ||
/* long型的字节数为4 */ | ||
printf("long:%d bytes\n",sizeof(long)); | ||
/* float型的字节数为4 */ | ||
printf("float:%d bytes\n",sizeof(float)); | ||
/* double型的字节数为8 */ | ||
printf("double:%d bytes\n",sizeof(double)); | ||
/* long double型的字节数为8或10或12 */ | ||
printf("long double:%d bytes\n",sizeof(long double)); | ||
getchar(); | ||
|
||
} | ||
|
||
|
||
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,18 @@ | ||
/* */ | ||
#include <stdio.h> | ||
main() | ||
{ | ||
int a=5,b,c,i=10; | ||
b=a++; | ||
c=++b; | ||
|
||
printf("a = %d, b = %d, c = %d\n",a,b,c); | ||
printf("i,i++,i++ = %d,%d,%d\n",i,i++,i++); | ||
printf("%d\n",++i); | ||
printf("%d\n",--i); | ||
printf("%d\n",i++); | ||
printf("%d\n",i--); | ||
printf("%d\n",-i++); | ||
printf("%d\n",-i--); | ||
getchar(); | ||
} |
Binary file not shown.
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,25 @@ | ||
#include <stdio.h> | ||
main() | ||
{ | ||
int i,j,n; | ||
long sum=0,temp=0; | ||
|
||
printf("Please input a number to n:\n"); | ||
scanf("%d",&n); | ||
if(n<1) | ||
{ | ||
printf("The n must no less than 1!\n"); | ||
return; | ||
} | ||
|
||
for(i=1;i<=n;i++) | ||
{ | ||
temp=0; | ||
for(j=1;j<=i;j++) | ||
temp+=j; | ||
sum+=temp; | ||
} | ||
printf("The sum of the sequence(%d) is %d\n",n,sum); | ||
getchar(); | ||
getchar(); | ||
} |
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 @@ | ||
0 |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.