这是一个简单的C语言编程题,请用C语言编辑下。这几天要交,请您尽快回答谢谢啦。(用VC6.0软件编写) c语言题目,输入一个日期,计算并输出该日期是当年的第几天,谢...

\u8fd9\u662f\u4e00\u4e2a\u7b80\u5355\u7684C\u8bed\u8a00\u7f16\u7a0b\u9898\uff0c\u660e\u5929\u5c31\u8981\u4ea4\u4e86\uff0c\u8c22\u8c22

\u6211\u4ee5\u524d\u505a\u7684....\u8981\u6309\u4f60\u8fd9\u4e2a\u505a\u4e0d\u662f\u4e00\u4e0b\u4e24\u4e0b\u5f04\u5f97\u5b8c\u7684\u5427........
\u4f60\u770b\u770b\u80fd\u76d6\u7740\u7528\u5c31\u6539\u8fd9\u7528\u5427

vc,tc,win-tc\u7f16\u8bd1\u901a\u8fc7
33\uff0e\u5b66\u751f\u6210\u7ee9\u7ba1\u7406\u7a0b\u5e8f\u8bbe\u8ba1
\uff081\uff09\u9009\u9879\u83dc\u5355\u96c6\u6210\u5404\u529f\u80fd\u51fd\u6570\u6a21\u5757
\uff082\uff09\u5f55\u5165\u5b66\u751f\u6210\u7ee9\uff08\u59d3\u540d\u3001\u5b66\u53f7\u3001\u8bed\u6587\u3001\u6570\u5b66\u6210\u7ee9\uff0c\u603b\u5206\u81ea\u52a8\u8ba1\u7b97\uff09
\uff083\uff09\u6309\u603b\u5206\u6392\u540d\u6b21
\uff084\uff09\u6309\u59d3\u540d\u67e5\u627e\u67d0\u5b66\u751f\u6210\u7ee9
\uff085\uff09\u7edf\u8ba1\u5404\u8bfe\u7a0b\u7684\u5e73\u5747\u5206\u3001\u53ca\u683c\u7387\u3001\u6700\u9ad8\u5206\u3001\u6700\u4f4e\u5206
#include "stdio.h"
#include "windows.h"
int sum=0,x,data=0;
struct STU
{
char name[20];
char num[20];
int chinese_great;
int math_great;
int all;
}stu[200];/*\u5b9a\u4e49\u5b66\u751f\u7ed3\u6784\u4f53\u4ee5\u53ca\u5b66\u751f\u7ed3\u6784\u4f53\u6570\u7ec4*/
struct STU *temp;
struct STU *p[200];
void in();/*\u81ea\u5b9a\u4e49\u5b66\u751f\u4fe1\u606f\u8f93\u5165\u51fd\u6570*/
void all_swap();/*\u603b\u5206\u6392\u540d*/
void menu();/*\u83dc\u5355*/
void name_swap();/*\u59d3\u540d\u67e5\u627e*/
void tongji();/*\u7edf\u8ba1*/
int ssame(char a[],char b[]);/*\u5b57\u7b26\u4e32\u6bd4\u5bf9\u51fd\u6570*/
void over();/*\u9000\u51fa*/

void main()
{
menu();
switch (x)
{
case 1 : data=1;system("cls");in();break;
case 2 : system("cls");all_swap();break;
case 3 : system("cls");name_swap();break;
case 4 : system("cls");tongji();break;
}

}
/*\u83dc\u5355*/
void menu()
{
system("cls");
printf("******************************\u5b66\u751f\u6210\u7ee9\u7ba1\u7406\u7cfb\u7edf****************************\n");
printf("\u8bf7\u9009\u62e9\u4f60\u9700\u8981\u7684\u64cd\u4f5c:\n");
printf("1.\u5f55\u5165\u5b66\u751f\u6210\u7ee9\uff08\u59d3\u540d\u3001\u5b66\u53f7\u3001\u8bed\u6587\u3001\u6570\u5b66\u6210\u7ee9\uff0c\u603b\u5206\u81ea\u52a8\u8ba1\u7b97\uff09\n");
printf("2.\u6309\u603b\u5206\u6392\u540d\u6b21\n");
printf("3.\u6309\u59d3\u540d\u67e5\u627e\u67d0\u5b66\u751f\u6210\u7ee9\n");
printf("4.\u7edf\u8ba1\u5404\u8bfe\u7a0b\u7684\u5e73\u5747\u5206\u3001\u53ca\u683c\u7387\u3001\u6700\u9ad8\u5206\u3001\u6700\u4f4e\u5206\n");
printf("5.\u6253\u5370\u6210\u7ee9\u8868\n");
scanf("%d",&x);

}
/*\u5b66\u751f\u4fe1\u606f\u8f93\u5165\u51fd\u6570*/
void in()
{
int i;
int end=1;
for(i=0;i<200;i++)
{
sum++;
printf("\u8bf7\u8f93\u5165\u7b2c%d\u4e2a\u5b66\u751f\u7684\u59d3\u540d: ",i+1);
scanf("%s",&stu.name);
printf("\u8bf7\u8f93\u5165\u7b2c%d\u4e2a\u5b66\u751f\u7684\u5b66\u53f7: ",i+1);
scanf("%s",&stu.num);
printf("\u8bf7\u8f93\u5165\u7b2c%d\u4e2a\u5b66\u751f\u7684\u8bed\u6587\u6210\u7ee9: ",i+1);
scanf("%d",&stu.chinese_great);
printf("\u8bf7\u8f93\u5165\u7b2c%d\u4e2a\u5b66\u751f\u7684\u6570\u5b66\u6210\u7ee9: ",i+1);
scanf("%d",&stu.math_great);
stu.all=stu.chinese_great+stu.math_great;
printf("\n\n\n\n\n \n 1:\u7ee7\u7eed\u5f55\u5165\n 2:\u7ed3\u675f\u5f55\u5165\n \u8bf7\u9009\u62e9\uff1a");
scanf("%d",&end);
if(end==2)
break;
else if (end==1) system("cls");
else over();
}/*FOR\u7ed3\u675f*/
system("cls");
main();
}/*\u5b66\u751f\u4fe1\u606f\u8f93\u5165\u51fd\u6570\u7ed3\u675f*/
/*\u6309\u603b\u5206\u6392\u540d*/
void all_swap()
{
int i,j,q=0;
for(i=0;i<=sum;i++)
p=&stu;

for(i=0;i<=sum-1;i++)
for (j=i+1;j<=sum;j++)
{
if(stu.all<stu[j].all)
{
temp=p;
p=p[j];
p[j]=temp;

}

}
printf(" \u540d\u6b21 \u59d3\u540d \u5b66\u53f7 \u603b\u6210\u7ee9 \n");
for(i=0;i<sum;i++)
printf(" %d %s %s %d \n",i+1,p->name,p->num,p->all);
printf("\u8f93\u5165 1 \u8fd4\u56de\u4e3b\u83dc\u5355\uff0c\u8f93\u5165\u5176\u4ed6\u9000\u51fa");
scanf("%d",&q);
if(q==1)
{
system("cls");
main();
}
else over();

}/*\u603b\u5206\u67e5\u8be2\u7ed3\u675f*/
/*\u540d\u5b57\u67e5\u8be2*/
void name_swap()
{
int i,q;
char temp[20];
for(i=0;i<=sum;i++)
p=&stu;

printf("\n\n\n\n\n\n\n\n\n\ \u8bf7\u8f93\u5165\u60a8\u8981\u67e5\u8be2\u7684\u5b66\u751f\u59d3\u540d\n");
scanf("%s",&temp);
for (i=0;i<=sum;i++)
{
if(ssame(temp,p->name)==0)
{
system("cls");
printf("\u4f60\u6240\u67e5\u627e\u7684\u5b66\u751f\u5df2\u627e\u5230\n \u59d3\u540d\uff1a%s \n \u5b66\u53f7\uff1a %s \n \u6570\u5b66\u6210\u7ee9\uff1a%d \n \u8bed\u6587\u6210\u7ee9\uff1a%d \n \u603b\u6210\u7ee9\uff1a%d ",p->name,p->num,p->chinese_great,p->math_great,p->all);
printf("\n\n\n\n\n\n \u8f93\u5165 1 \u8fd4\u56de\u4e3b\u83dc\u5355\uff0c\u8f93\u5165\u5176\u4ed6\u9000\u51fa");
scanf("%d",&q);
if(q==1)
{
system("cls");
main();
}
else over();
}
else
{
system("cls");
printf("\n\n\n\n\n\n \u672a\u627e\u5230\u4e0e%s\u6709\u5173\u7684\u8bb0\u5f55",temp);
printf("\n\n\n\n\n\n \u8f93\u5165 1 \u8fd4\u56de\u4e3b\u83dc\u5355\uff0c\u8f93\u5165\u5176\u4ed6\u9000\u51fa");
scanf("%d",&q);
if(q==1)
{
system("cls");
main();
}
else over();
}

}

} /*\u540d\u5b57\u67e5\u8be2\u7ed3\u675f*/
/*\u7edf\u8ba1*/
void tongji()
{
int i,q,chinese_max=0,chinese_min=9999,math_max=0,math_min=9999;long sum_chinese=0,sum_math=0;
float chinese_v,math_v,chinese_p,math_p,p_c=0,p_m=0;
if(data==1)
{

for(i=0;i<=sum;i++)
{
p=&stu;
sum_chinese=p->chinese_great+sum_chinese;
sum_math=p->math_great+sum_math;
if(p->chinese_great>=60)
p_c++;
if(p->math_great>=60)
p_m++;


}
chinese_v=sum_chinese/sum;/*\u8bed\u6587\u5e73\u5747\u5206*/
math_v=sum_math/sum;/*\u6570\u5b66\u5e73\u5747\u5206*/
chinese_p=(p_c/sum)*100;/*\u8bed\u6587\u53ca\u683c\u7387*/
math_p=(p_m/sum)*100;/*\u6570\u5b66\u53ca\u683c\u7387*/
for(i=0;i<sum;i++)
{
chinese_max=max(chinese_max,p->chinese_great);
chinese_min=min(chinese_min,p->chinese_great);
math_max=max(math_max,p->math_great);
math_min=min(math_min,p->math_great);
}
printf(" \u79d1\u76ee \u5e73\u5747\u5206 \u53ca\u683c\u7387 \u6700\u9ad8\u5206 \u6700\u4f4e\u5206\n");
printf(" \u8bed\u6587 %f \u767e\u5206\u4e4b%f %d %d \n",chinese_v,chinese_p,chinese_max,chinese_min);
printf(" \u6570\u5b66 %f \u767e\u5206\u4e4b%f %d %d \n",math_v,math_p,math_max,math_min);
printf("\n\n\n\n\n\n \u8f93\u5165 1 \u8fd4\u56de\u4e3b\u83dc\u5355\uff0c\u8f93\u5165\u5176\u4ed6\u9000\u51fa");
scanf("%d",&q);
if(q==1)
{
system("cls");
main();
}
else over();

}
else main();
}
/*\u5b57\u7b26\u4e32\u6bd4\u5bf9*/
int ssame(char a[],char b[])
{
int p=0,flag=0;
while (a[p]!='\0'||b[p]!='\0')
{
if((a[p]>b[p]) || (a[p]<b[p]))
{
flag=1;break;
}

p++;
}
if(flag==0)
{
if((a[p]!='\0') || (b[p]!='\0'))
flag=1;
}
return flag;
}/*\u5b57\u7b26\u4e32\u6bd4\u5bf9\u7ed3\u675f*/
/*\u9000\u51fa*/
void over()
{
int q;
system("cls");
printf("\n\n\n\n\n\n\n\n\n \u6b64\u64cd\u4f5c\u5c06\u5bfc\u81f4\u4f60\u9000\u51fa\u672c\u7a0b\u5e8f\u3002\n1\uff1a\u786e\u8ba4\u9000\u51fa \n2\uff1a\u8fd4\u56de\u4e3b\u83dc\u5355");
scanf("%d",&q);
if(q==1)
exit(1);
else if (q==2)
main();
else over();
}

#include int main(){ int day = 0; int y = 0; int m = 1; int d = 0; scanf("%d-%d-%d", &y, &m, &d); switch(m-1) //\u6545\u610f\u6ca1\u6709\u5728case\u91cc\u52a0break { case 11: day += 30; case 10: day += 31; case 9: day += 30; case 8: day += 31; case 7: day += 31; case 6: day += 30; case 5: day += 31; case 4: day += 30; case 3: day += 31; case 2: if((y % 4 == 0 && y % 100 != 0) ||y%400==0) { day += 29; } else { day += 28; } case 1: day += 31; default: break; } printf("%d", day+=d); return 0; }\u793a\u4f8b\u8fd0\u884c\u7ed3\u679c\uff1a
2016-10-28
302

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_STEP 20

//index: 0 - 狼,1-羊,2-菜,3-农夫,value:0-本岸,1-对岸
int a[MAX_STEP][4];
int b[MAX_STEP];

char *name[] =
{
"空手",
"带狼",
"带羊",
"带菜"
};

void search(int iStep)
{
int i;
if (a[iStep][0] + a[iStep][1] + a[iStep][2] + a[iStep][3] == 4)
{
for (i = 0; i < iStep; i++)
{
if (a[i][3] == 0)
{
printf("%s到对岸\n", name[b[i] + 1]);
}
else
{
printf("%s回本岸\n", name[b[i] + 1]);
}
}
printf("\n");
return;
}
for (i = 0; i < iStep; i++)
{
if (memcmp(a[i], a[iStep], sizeof(a[i])) == 0)
{
return;
}
}
if (a[iStep][1] != a[iStep][3] && (a[iStep][2] == a[iStep][1] || a[iStep][0] == a[iStep][1]))
{
return;
}
for (i = -1; i <= 2; i++)
{
b[iStep] = i;
memcpy(a[iStep + 1], a[iStep], sizeof(a[iStep + 1]));
a[iStep + 1][3] = 1 - a[iStep + 1][3];
if (i == -1)
{
search(iStep + 1);
}
else if (a[iStep][i] == a[iStep][3])
{
a[iStep + 1][i] = a[iStep + 1][3];
search(iStep + 1);
}
}
}

int main()
{
search(0);
return 0;
}

//pastriver.c
/***********************************
This code is used to answer the past
river question.
Note: 12/2/2006
coded by YunDanFengQing
www.cfannet.com
***********************************/

#include <stdio.h>

#define MAX 100

typedef enum BOOL
{
FALSE = 0, TRUE = 1
}BOOL;

typedef union Items
{
struct
{
char boy : 1;
char girl : 1;
char father : 1;
char mother : 1;
char police : 1;
char thief : 1;
char : 0;
};
char c;
}*pItems, Items;

struct
{
Items item[MAX];
int boat[MAX];
int length;
}stack;

int Boat[2];
Items ItemMask[12];
char* msg[4] = { "comes back single.", "comes back together.",
"pasts the river single.", "past the river together." };
char* msgn[12] = { "father", "mother", "police", "thief",
"police and the thief", "police and the father",
"police and the mother", "police and the boy",
"police and the girl", "father and the boy",
"mother and the girl", "father and the mother"};

BOOL IsLegal ( Items item )
{
Items t1, t2, t3;
Items t4, t5, t6;
t1.c = 0, t2.c = 0, t3.c = 0;
t4.c = 0, t5.c = 0, t6.c = 0;

t1.girl = 1, t1.father = 1, t1.mother = 0;
t4.girl = 1, t4.father = 1, t4.mother = 1;
t2.boy = 1, t2.father = 0, t2.mother = 1;
t5.boy = 1, t5.father = 1, t5.mother = 1;
t3.thief = 1, t3.police = 0;
t6.thief = 1, t6.police = 1;

if (( t4.c & item.c ) == t1.c ) {
return FALSE;
}
if (( t5.c & item.c ) == t2.c ) {
return FALSE;
}
if ((( item.c & t6.c ) == t3.c ) && (( item.c ^ t3.c ) != 0)) {
return FALSE;
}
return TRUE;
}

BOOL IsInStack ( Items item, int boat )
{
int i = 0;
for ( i = 0; i < stack.length; ++i ) {
if (( item.c == stack.item[i].c ) && ( boat == stack.boat[i] )) {
return TRUE;
}
}
return FALSE;
}

BOOL IsStackFull ()
{
return stack.length >= MAX ? TRUE : FALSE;
}

BOOL Rule ( pItems itemL, pItems itemR, int boat, int i )
{
Items left, right;
if ( 0 == boat ) {
left.c = itemL->c;
right.c = itemR->c;
}
else {
left.c = itemR->c;
right.c = itemL->c;
}

if (( left.c & ItemMask[i].c ) != ItemMask[i].c ) {
return FALSE;
}
left.c ^= ItemMask[i].c;
right.c ^= ItemMask[i].c;

if ( 0 == boat ) {
itemL->c = left.c;
itemR->c = right.c;
}
else {
itemL->c = right.c;
itemR->c = left.c;
}
return TRUE;
}

BOOL PastRiver ( Items itemL, Items itemR, int boat )
{
Items newL, newR;
int i = 0, j = 0;

if ( itemL.c == 0 ) {
return TRUE;
}

for ( i = 0; i < 12; ++i ){
newL.c = itemL.c, newR.c = itemR.c;
if ( TRUE == Rule ( &newL, &newR, boat, i )) {
if (( TRUE == IsLegal (newL)) && ( TRUE == IsLegal (newR) )) {
if (( FALSE == IsInStack ( newL, boat )) && ( FALSE == IsStackFull() )) {
stack.item[stack.length].c = newL.c;
stack.boat[stack.length] = boat;
stack.length ++;
if ( TRUE == PastRiver ( newL, newR, Boat[boat] )) {
if (( 0 == boat ) && ( i < 4 )) {
j = 2;
}
if (( 0 == boat ) && ( i >= 4 )) {
j = 3;
}
if (( 1 == boat ) && ( i < 4 )) {
j = 0;
}
if (( 1 == boat ) && ( i >= 4 )) {
j = 1;
}
printf ( "The %s %s\n", msgn[i], msg[j] );
return TRUE;
}
}
}
}
}
return FALSE;
}

void Init()
{
int i = 0;
stack.length = 0;
Boat[0] = 1;
Boat[1] = 0;
for ( i = 0; i < 12; ++i ) {
ItemMask[i].c = 0;
}
ItemMask[0].father = 1;
ItemMask[1].mother = 1;
ItemMask[2].police = 1;
ItemMask[3].thief = 1;
ItemMask[4].police = 1, ItemMask[4].thief = 1;
ItemMask[5].police = 1, ItemMask[5].father = 1;
ItemMask[6].police = 1, ItemMask[6].mother = 1;
ItemMask[7].police = 1, ItemMask[7].boy = 1;
ItemMask[8].police = 1, ItemMask[8].girl = 1;
ItemMask[9].father = 1, ItemMask[9].boy = 1;
ItemMask[10].mother = 1, ItemMask[10].girl = 1;
ItemMask[11].father = 1, ItemMask[11].mother = 1;
}

int main ()
{
Items itemL, itemR;
itemL.c = 0, itemR.c = 0;
itemL.father = 1, itemL.mother = 1;
itemL.boy = 1, itemL.girl = 1;
itemL.police = 1, itemL.thief = 1;

Init();
stack.item[stack.length].c = itemL.c;
stack.boat[stack.length] = 1;
stack.length++;
if ( FALSE == PastRiver ( itemL, itemR, 0 )) {
printf ("BAD!!\n");
}
getchar();
return 0;
}

给你思路你自己写:
1 你把羊带过去 (这边是狼和白菜)
2 你把白菜带过去,把羊带回来(那边只有白菜)
3 你把狼带过去 (这边只有羊)
4 你把羊带过去

把条件列完调用下就可以了

不用

  • C璇█缂栫▼棰,璇缂栧啓璁捐涓涓寤舵椂瀛愬嚱鏁癲elaynms(int n)鐢ㄦ潵寤舵椂0.5绉掔殑...
    绛旓細澹版槑瀹氫箟锛歷oid delaynms(int n) //n: millisecond{ int i,j; for(i=0;i<n;i++) for(int j=0;j<500);}璋冪敤锛歞elaynms(500); //delay 0.5 second
  • 璇峰ぇ绁炰滑甯繖瑙e喅涓涓猚璇█鐨勭紪绋嬮,鍏蜂綋闂濡備笅:
    绛旓細}for(S=0;S<8;S++){for(i=0;i<len && n[i]<=n[i+1];i++);if(S>0)printf(",");printf("%c",n[i]); //杈撳嚭琚垹闄ょ殑鏁板瓧for(;i<len;i++) //鐢变簬琚垹闄や簡涓涓鏁板瓧锛岄渶瑕佹暣鐞嗕笅鏁扮粍n[i]=n[i+1];len--;}printf("\n");...
  • C璇█缂栫▼棰樼洰 缁涓涓瀛楃涓,璇鎵惧嚭鍑虹幇娆℃暟鏈澶氱殑澶у啓鑻辨枃瀛楁瘝銆俖鐧 ...
    绛旓細for锛坕锛0锛沬锛渓en锛沬锛嬶紜锛塱f锛坅锛籭锛斤紴锛濓紘A锛囷紗锛哸锛籭锛斤紲锛濓紘Z锛囷級fre锛籥锛籭锛斤紞锛嘇锛囷冀锛嬶紜锛沠or锛坕锛0锛沬锛26锛沬锛嬶紜锛塱f锛坒re锛籭锛斤紴big锛塨ig锛漟re锛籭锛斤紱for锛坕锛0锛沬锛26锛沬锛嬶紜锛塱f锛坆ig锛濓紳fre锛籭锛斤級锝 printf锛堬紓锛卌锛糿锛傦紝i锛嬶紘a锛囷級锛沚reak锛涳綕 锝 ...
  • 涓閬C璇█缂栫▼棰姹傝В
    绛旓細鍏舵,瑙傚療姣忛」鍙栧间箣闂寸殑鍏崇郴,杩欓鏄瘡椤归兘鏄墠涓椤逛箻浠10鍐嶅姞a寰楀埌 杩欓涔熸病鏈夐」椤哄簭鍏崇郴,姣忛」閮芥槸鍑忔硶,鍥犳鍙互绠鍖栨垚姹傜疮鍑 姣忛」鐢涓涓鍙橀噺t鏉ョ畻,涓寮濮嬪垵鍊间负0,褰撳墠椤瑰氨鏄痶涔樹互10鐒跺悗鍔燼,浜庢槸绗1椤逛负a,绗2椤逛负a*10+a=aa,...,寰幆n娆″緱鍒版渶澶ч偅涓暟 鍏蜂綋鍒扮▼搴,涓绠鍗璧疯,姹傜疮鍑,...
  • 涓閬绠鍗曠殑鑻辨枃杩伴鐨凜璇█缂栫▼棰銆傝姹傜瓟妗堟濊矾绮剧‘銆傝阿!
    绛旓細鐒跺悗鐢ㄥ畠鍔ㄦ佺敓鎴涓涓鏁扮粍锛岀敤杩欎釜鏁扮粍鏉ヤ繚瀛樻瘡涓琛宎+b鐨勫硷紝浠g爜濡備笅锛歩nt main(){ int n;cin>>n;int x,y;int *p=new int[n];for(int i=0;i<n;i++){ cin>>x>>y;p[i]=x+y;} for(int i=0;i<n;i++){ cout<<p[i]<<endl;} delete p;return 0;} ...
  • C璇█缂栫▼棰
    绛旓細include<stdio.h>#include<stdlib.h>#include#define stuNum 15//瀛︾敓浜烘暟#define scNum 7//妯″潡鏁皌ypedef struct stu//瀹氫箟瀛︾敓鏁版嵁缁撴瀯{ int sid;//瀛︾敓ID int sc[scNum];//瀵瑰簲7涓ā鍧楁垚缁 int sum;//鎬绘垚缁﹠STU;void insertSTU(STU *stu);//杈撳叆15涓鐢熺殑淇℃伅void insertTest...
  • C璇█缂栫▼棰
    绛旓細elif max_num == c and min_num == d:print(max_num, b, a, min_num)鍏朵腑锛岄鍏堢敤if璇彞鍒ゆ柇4涓暣鏁扮殑鏈澶у煎拰鏈灏忓硷紝鐒跺悗閫氳繃涓绯诲垪if璇彞鏉ョ‘瀹氬畠浠殑鎺掑垪椤哄簭锛屽苟灏嗗畠浠寜浠庡ぇ鍒板皬鐨勯『搴忚緭鍑恒俰nclude <stdio.h> int main() { double ma, tr, tax, net;printf("璇疯緭鍏ュ閲戞暟锛...
  • 绠鍗旵璇█缂栫▼,姹傝В绛
    绛旓細s=(a+b+c)/2;S=sqrt(s*(s-a)*(s-b)*(s-c))+0.0005;printf("\n涓夎褰㈢殑闈㈢Н涓猴細%10.3lf",S);getch();} 锛堥檮鍔犻锛6.缂栫▼灏嗙敤鎴疯緭鍏ョ殑鍗佽繘鍒舵暟杞崲鎴愬崄鍏繘鍒舵暟鍜屽叓杩涘埗鏁帮紝骞惰緭鍑猴紝瑕佹眰鐣岄潰鍙嬪ソ銆俰nclude "stdio.h"main(){ int n;printf("璇疯緭鍏涓涓鍗佽繘鍒舵暟锛");scanf(...
  • C璇█缂栫▼棰.绛旀瓒绠鍗瓒婂ソ
    绛旓細char yesorno; if((fp=fopen("C://student.dat","rb"))==NULL){ printf("\n===>鎻愮ず锛氭枃浠朵笉瀛樺湪锛屾槸鍚﹁鍒涘缓涓涓?(y/n)\n");scanf("%c",&yesorno);if(yesorno=='y'||yesorno=='Y'){ fp=fopen("C://student.dat","wb");fclose(fp);} else exit(0);} else { N...
  • C璇█缂栫▼棰,鎬,璇澶у甯繖鍟,涓嶄細鐨勪篃璇曡瘯鍟,鎬
    绛旓細intx[12]={2,45,67,12,3,9,76,45,23,42,6,5};inti,sum=0,count=0;printf("\n鏁扮粍x鐨勫厓绱犱负锛");for(i=0;i<12;i++){ printf("%5d",x[i]);if(x[i]%2==1){ count++;sum+=x[i];} } printf("\n鏁扮粍x涓叡鏈夊鏁%5d涓紝鎵鏈夊鏁颁箣鍜屼负%5d\n鈥,count,sum);} ...
  • 扩展阅读:编程一般要学多久 ... 编程题库100题 ... 扫一扫题目出答案 ... c语言必背100代码 ... 初学编程必背50个 ... c++常考编程题 ... 编程必背100个代码 ... c语言编译器手机版app ... 大一c语言必背编程题 ...

    本站交流只代表网友个人观点,与本站立场无关
    欢迎反馈与建议,请联系电邮
    2024© 车视网