Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
arrstruct.c
Package: C语言精彩编程百例_源代码.rar [view]
Upload User: bjtelijie
Upload Date: 2010-01-01
Package Size: 87k
Code Size: 1k
Category:
Algorithm
Development Platform:
Visual C++
- /* 输入学生成绩并显示 */
- # include <stdio.h>
- struct student
- {
- char number[6];
- char name[6];
- int score[3];
- } stu[2];
- void output(struct student stu[2]);
- void main()
- {
- int i, j;
- for(i=0; i<2; i++)
- {
- printf("请输入学生%d的成绩:n", i+1);
- printf("学号:");
- scanf("%s", stu[i].number);
- printf("姓名:");
- scanf("%s", stu[i].name);
- for(j=0; j<3; j++)
- {
- printf("成绩 %d. ", j+1);
- scanf("%d", &stu[i].score[j]);
- }
- printf("n");
- }
- output(stu);
- }
- void output(struct student stu[2])
- {
- int i, j;
- printf("学号 姓名 成绩1 成绩2 成绩3n");
- for(i=0; i<2; i++)
- {
- printf("%-6s%-6s", stu[i].number, stu[i].name);
- for(j=0; j<3; j++)
- printf("%-8d", stu[i].score[j]);
- printf("n");
- }
- }