博文

QQ好友管理程序(2005-08-07 10:47:00)

摘要:#include "stdio.h"
#include "conio.h"

struct qq
{
char num[12];
char name[10];
char age[2];
}Qq[1];
main()
{
int kk=1;char choice;
loop2 : init();
loop : scanf("%c",&choice);
switch(choice)
{
case 'n': case 'N': newf();break;
case 'a': case 'A': break;
case 'l': case 'L': system("cls");listf();getch();system("cls");goto loop2;
case 'f': case 'F': findf();getch();goto loop2;
case 'd': case 'D': deletef();getch();goto loop2;
case 'q': case 'Q': return 0;
default: goto loop;
}
while(kk==1)
{
addf();
printf("enter 1 to continue add.\n");
scanf("%d",&kk);
system("cls");
}
goto loop2;
}


int init()
{
printf("\n**************************************\n");
printf("******第一次用本程序请按n(new)********\n");
printf("*********增加记录请按a(add)......

阅读全文(5301) | 评论:1

成绩系统(2005-08-07 10:37:00)

摘要:#include <iostream.h>
#include <string.h>
#include <fstream.h>

struct student
{
char num[10];
char name[20];
int  age;
int  score;
struct student *next;
};
class grade
{
private :
    struct student * head,* last;    
public :
    void init();
    void insert();
    int delete();
    int select();
    int modify();
    int display();
    int total();
    void savefile();
    void quit();
};

void grade::init()
{
printf("************************************主菜单************************************\n");
printf("\t1输入学生资料\t\t\t\t\t2删除学生资料\n");
printf("\t3查询学生资料\t\t\t\t\t4修改学生资料\n"......

阅读全文(3966) | 评论:0

聊天(C++)(2005-08-07 10:33:00)

摘要:1  局域网聊天的程序(C++版)  
  //server
#include <winsock.h>
#include <iostream.h>
#include <stdio.h>
#include <string.h>
#include <windows.h>
#define PORT 100
#define socklen_t int
#pragma comment(lib, "wsock32.lib")
SOCKET s;
SOCKET client;
sockaddr_in from;
void ServerThread()
{
char message[256];
while(1)
{
strcpy(message,"");
int len=recv(client,message,sizeof(message),0);
if (strcmp(message,"")!=0)
{
cout<<"从"<<inet_ntoa(from.sin_addr)<<"得到消息:\n";
//cout<<"len:"<<len<<endl;
message[len]='\0';
cout<<message;
}
}
}
int main()
{
sockaddr_in srv;
int fromlen=sizeof(from);
char message[256]="Welcome!\n";
WSADATA wsadata;
WORD VersionRequested=MAKEWORD(1,1);
if (WSAStartup(VersionRequ......

阅读全文(5482) | 评论:1