當前位置:首頁 » 編程語言 » c語言的提綱

c語言的提綱

發布時間: 2024-11-01 03:34:07

c語言是什麼意思干什麼的

c語言就是一個編程語言有什麼微縫還有什麼c語言java什麼的他就是一個底層的語言。就是計算機的一個入門的一個編程的作用,嗯,這個是學計算機的人,等待都會懂。我等你上學了你就知道了。

❷ C語言課程設計~~~ 要求編寫一段程序,題目是《校際運動會管理系統》

我這是源代碼已經調試過了,在VC++上運行成功了。
#include "stdio.h" /*I/O函數*/
#include "stdlib.h" /*其它說明*/
#include "string.h" /*字元串函數*/
#include "conio.h" /*屏幕操作函數*/
#include "mem.h" /*內存操作函數*/
#include "ctype.h" /*字元操作函數*/
#include "alloc.h" /*動態地址分配函數*/
struct score
{
int mingci;
char xuehao[8];
char mingzi[20];
float score[6];
}data,info[1000];
int i,j,k=0;
char temp[20],ch;
FILE *fp,*fp1;

void shuru()
{
if((fp=fopen("s_score.txt","ab+"))==NULL)
{
printf("cannot open this file.\n");
getch();exit(0);
}
for(i=0;i<=1000;i++)
{
printf("\nPlease shuru xuehao:");
gets(data.xuehao);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please shuru wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please shur huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];
fwrite(&data,sizeof(data),1,fp);
printf("another?y/n");
ch=getch();
if(ch=='n'||ch=='N')
break;
} fclose(fp);
}
void xianshi()
{
float s;int n;
if((fp=fopen("s_score.txt","rb+"))==NULL)
{
printf("Cannot reading this file.\n");
exit(0);
}
for(i=0;i<=1000;i++)
{
if((fread(&info[i],sizeof(info[i]),1,fp))!=1)
break;
}
printf("\nxuehao mingzi yuwen shuxue yingyu wuli huauxue zhongfen\n");
for(j=0,k=1;j<i;j++,k++)
{
info[j].mingci=k;
printf("%6s %8s %3.1f %3.1f %3.1f %3.1f %3.1f %3.1f\n",info[j].xuehao,info[j].mingzi,info[j].score[0],info[j].score[1],info[j].score[2],info[j].score[3],info[j].score[4],
info[j].score[5]);
}
getch();
fclose(fp);
}

void xiugai()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("Cannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xiugai xuehao:");
scanf("%d",&i); getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{
printf("xuehao:%s\nmingzi:%s\n",data.xuehao,data.mingzi);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=atof(temp);
printf("Please shuru shuxue score:");
gets(temp);data.score[1]=atof(temp);
printf("Please input yingyu score:");
gets(temp);data.score[2]=atof(temp);
printf("Please input wuli score:");
gets(temp);data.score[3]=atof(temp);
printf("Please input huaxue score:");
gets(temp);data.score[4]=atof(temp);
data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];

} fwrite(&data,sizeof(data),1,fp1);
}
fseek(fp,0L,0);
fseek(fp1,0L,0);
while((fread(&data,sizeof(data),1,fp1))==1)
{
fwrite(&data,sizeof(data),1,fp);
}

fclose(fp);
fclose(fp1);
}
void chazhao()
{
if((fp=fopen("s_score.txt","rb"))==NULL)
{
printf("\nCannot open this file.\n");
exit(0);
}
printf("\nPLease shuru xuehao chakan:");
scanf("%d",&i);
while(fread(&data,sizeof(data),1,fp)==1)
{
j=atoi(data.xuehao);
if(i==j)
{
printf("xuehao:%s mingzi:%s\nyuwen:%f\n shuxue:%f\n yingyu:%f\n wuli:%f\n huaxue:%f\n ",data.xuehao,data.mingzi,data.score[0],data.score[1],data.score[2],data.score[3],data.score[4],data.score[5]);
}getch();
}
}
void shanchu()
{
if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL)
{
printf("\nopen score.txt was failed!");
getch();
exit(0);
}
printf("\nPlease input ID which you want to del:");
scanf("%d",&i);getchar();
while((fread(&data,sizeof(data),1,fp))==1)
{
j=atoi(data.xuehao);
if(j==i)
{

printf("Anykey will delet it.\n");
getch();
continue;
}
fwrite(&data,sizeof(data),1,fp1);
}
fclose(fp);
fclose(fp1);
remove("s_score.txt");
rename("temp.txt","s_score.txt");
printf("Data delet was succesful!\n");
printf("Anykey will return to main.");
getch();
}
main()
{
while(1)
{
clrscr(); /*清屏幕*/
gotoxy(1,1); /*移動游標*/
textcolor(YELLOW); /*設置文本顯示顏色為黃色*/
textbackground(BLUE); /*設置背景顏色為藍色*/
window(1,1,99,99); /* 製作顯示菜單的窗口,大小根據菜單條數設計*/
clrscr();
printf("*************welcome to use student manage******************\n");
printf("*************************menu********************************\n");
printf("* ========================================================= * \n");
printf("* 1>shuru 2>xiugai * \n");
printf("* 3>shanchu 4>chazhao * \n");
printf("* 5>xianshi 6>exit * \n");
printf("* * \n");
printf("* --------------------------------------------------------- * \n");
printf(" Please input which you want(1-6):");
ch=getch();
switch(ch)
{
case '1':shuru();break;
case '2':xiugai(); break;
case '3':shanchu(); break;
case '4':chazhao(); break;
case '5':xianshi(); break;
case '6':exit(0);
default: continue;
}
}

❸ 怎麼去學習編程c語言,我沒有一點數學基礎 還有就是看不懂裡面的代碼 需要怎樣去學 謝謝!

看不懂代碼可以找網上的公開課,都有免費的,老師講的也很詳細

熱點內容
伺服器搭建之後的維護 發布:2024-11-01 05:27:35 瀏覽:245
電腦加秘伺服器在哪啟動 發布:2024-11-01 05:26:02 瀏覽:983
路由器需要哪些配置 發布:2024-11-01 05:08:35 瀏覽:980
c語言小寫變大寫 發布:2024-11-01 05:06:47 瀏覽:553
伺服器級電腦主機聯想 發布:2024-11-01 05:06:46 瀏覽:658
資料庫工程師的 發布:2024-11-01 04:54:54 瀏覽:372
手機存儲擴充 發布:2024-11-01 04:41:13 瀏覽:53
上班密碼箱多少寸合適 發布:2024-11-01 04:39:08 瀏覽:454
訪問噴劑 發布:2024-11-01 04:26:32 瀏覽:622
我的世界監獄風雲淬煉伺服器 發布:2024-11-01 04:24:45 瀏覽:401