C_×ÛºÏʹÓÃÊý×éʵÏÖ¼òµ¥µÄѧÉú³É¼¨¹ÜÀíϵͳ
Ô´Â룺
/* ѧÉú³É¼¨²éѯϵͳ */
# include <stdio.h>
# include <stdlib.h>
int main( )
{
int select;
int i, j;
int score[5][7];
int average = 0;
int sum = 0;
do{
printf("±¾³ÌÐòÓÐ4ÏÄÜ£º\n");
printf(" 1. ¸ù¾ÝѧºÅ²éѯѧÉú³É¼¨\n");
printf(" 2. ¸ù¾Ý¿¼ÊÔºÅͳ¼Æ³É¼¨\n") ;
printf(" 3. ¸ù¾Ý¿¼ÊԺźÍѧºÅ²éѯ³É¼¨\n");
printf(" 4. ³É¼¨Â¼Èë\n");
printf(" 0. Í˳ö\n");
printf(" ÇëÊäÈëÑ¡Ôñ(0 - 4): ");
scanf("%d", &select);
switch(select)
{
case 0:
printf("Good-Bye~\n");
exit(0);
break;
case 1:
printf("ÊäÈëѧºÅ£º"); // ¸ù¾Ýiֵȷ¶¨Ñ§ºÅ£¬È»ºó°´Ñ§ºÅÊä³öÈ«²¿³É¼¨
scanf("%d\n", &i);
for(j=1; j<7; j++)
{
printf("µÚ%d¿Æ³É¼¨ÊÇ%d\n", j, score[i][j]);
sum += score[i][j]; // ʵÏÖÀÛ¼Ó
&nb
Ïà¹ØÎĵµ£º
C++¶Ôʱ¼äµÄ²Ù×÷Ò²ÓÐÐí¶àÖµµÃ´ó¼Ò×¢ÒâµÄµØ·½¡£×î½ü£¬ÔÚ¼¼ÊõȺÖÐÓкܶàÍøÓÑÒ²¶à´ÎÎʵ½¹ýC++ÓïÑÔÖжÔʱ¼äµÄ²Ù×÷¡¢»ñÈ¡ºÍÏÔʾµÈµÈµÄÎÊÌâ¡£ÏÂÃ棬ÔÚÕâƪÎÄÕÂÖУ¬±ÊÕß½«Ö÷Òª½éÉÜÔÚC/C++ÖÐʱ¼äºÍÈÕÆÚµÄʹÓ÷½·¨.
ͨ¹ýѧϰÐí¶àC/C++¿â£¬Äã¿ÉÒÔÓкܶà²Ù×÷¡¢Ê¹ÓÃʱ¼äµÄ·½·¨¡£µ«Ô ......
C/C++ÖеÄSplitº¯ÊýÊÇstrtok()Æ亯ÊýÔÐÍÈçÏÂ:
char * strtok (char * str, const char * delimiters);
º¯Êý˵Ã÷
strtok()ÓÃÀ´½«×Ö·û´®·Ö¸î³ÉÒ»¸ö¸öƬ¶Î¡£²ÎÊýstrÖ¸ÏòÓû·Ö¸îµÄ×Ö·û´®£¬²ÎÊýdelimitersÔòΪ·Ö¸î×Ö·û´®£¬µ±strtok()ÔÚ²ÎÊý
strµÄ×Ö·û´®Öз¢ÏÖµ½²ÎÊýdelimitersµÄ·Ö¸î×Ö·ûʱÔò»á½«¸Ã×Ö·û¸ÄΪ'\0'×Ö·û ......
Ô´Âë:
# include <stdio.h>
int main()
{
int x, y;
printf("ÇëÊäÈë×Ô±äÁ¿x£º");
scanf("%d", &x);
if(x < 6)
{
  ......
Ô´Âë:
# include <stdio.h>
int main()
{
/* sex´ú±íÊäѪÕßµÄÐÔ±ð£¬weight´ú±íÊäѪÕßµÄÌåÖØ£¬cubage´ú±íÊäѪÁ¿ */
int sex, weight, cubage;
printf("Çë¸ø³öÊäѪÕßµÄÐÔ±ð£¨Å®ÐÔΪ¸ºÊý£©ºÍÌåÖØ£º(ÓöººÅ¸ô¿ª)");
&nbs ......
Ô´Â룺
# include <stdio.h>
int main()
{
int array[16][16];
int i, j, k, m, n;
/* ±äÁ¿³õʼ»¯ */
m = 1;
while(m == 1)
{
  ......