Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Lellansin committed Aug 23, 2012
0 parents commit 0780421
Show file tree
Hide file tree
Showing 557 changed files with 57,059 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
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
163 changes: 163 additions & 0 deletions .gitignore
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 added 经典示例/001.第一个C程序/1.EXE
Binary file not shown.
6 changes: 6 additions & 0 deletions 经典示例/001.第一个C程序/1.c
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"); /* 打印输出信息 */
}
1 change: 1 addition & 0 deletions 经典示例/001.第一个C程序/TCTEMP.DAT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Binary file added 经典示例/001.第一个C程序/tempfile.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions 经典示例/002.运行多个源文件/helloword.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "print.h"

int main(void){
printHello();
return 0;
}
6 changes: 6 additions & 0 deletions 经典示例/002.运行多个源文件/print.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "print.h"

void printHello()
{
printf("hello word!\n");
}
3 changes: 3 additions & 0 deletions 经典示例/002.运行多个源文件/print.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "stdio.h"

void printHello(void);
Binary file added 经典示例/003.求整数之积/3.EXE
Binary file not shown.
10 changes: 10 additions & 0 deletions 经典示例/003.求整数之积/3.c
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); /* 输出结果 */
}
1 change: 1 addition & 0 deletions 经典示例/003.求整数之积/TCTEMP.DAT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Binary file added 经典示例/003.求整数之积/tempfile.exe
Binary file not shown.
Binary file added 经典示例/004.比较实数大小/4.EXE
Binary file not shown.
11 changes: 11 additions & 0 deletions 经典示例/004.比较实数大小/4.c
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 */
}

28 changes: 28 additions & 0 deletions 经典示例/005.字符的输出/5.C
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 added 经典示例/005.字符的输出/5.EXE
Binary file not shown.
28 changes: 28 additions & 0 deletions 经典示例/006.显示变量所占字节数/6.C
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.
18 changes: 18 additions & 0 deletions 经典示例/007.自增自减运算/7.C
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 added 经典示例/007.自增自减运算/7.EXE
Binary file not shown.
Binary file added 经典示例/007.自增自减运算/tempfile.exe
Binary file not shown.
25 changes: 25 additions & 0 deletions 经典示例/008.数列求和/8.C
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 added 经典示例/008.数列求和/8.EXE
Binary file not shown.
1 change: 1 addition & 0 deletions 经典示例/008.数列求和/TCTEMP.DAT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Binary file added 经典示例/008.数列求和/tempfile.exe
Binary file not shown.
Binary file added 经典示例/009.乘法口诀表/9.EXE
Binary file not shown.
Loading

0 comments on commit 0780421

Please sign in to comment.