救救萌新吧,为啥用链表就行不通

P1424 小鱼的航程(改进版)

希望更丰富的展现?使用Markdown
by Luvwgyx @ 2019-03-02 17:03:14


希望更丰富的展现?使用Markdown
by jins3599 @ 2019-03-02 17:04:19


**希望更丰富的展现?使用$Markdown$**
by Wolfycz @ 2019-03-02 17:05:35


##### 希望更丰富的展现?使用Markdown
by mzryぃ @ 2019-03-02 17:07:47


不希望更丰富的展现?不使用Markdown
by wxwoo @ 2019-03-02 17:07:56


希望更丰富的展现?使用Markdown
by 千华缭乱 @ 2019-03-02 17:14:54


```c ``` #include<stdio.h> struct week {int num; struct week *next; }day[7]; int main() {int i,x,n,weekend=0,s; struct week *p=&day[x-1]; for(i=0;i<7;i++) {if(i==6){day[i].next=&day[0];day[i].num=7;break;} day[i].next=&day[i+1]; day[i].num=i+1; } scanf("%d %d",&x,&n); for(i=1;i<=n;i++) {if(p->num==6||p->num==7)weekend++; p=p->next; } s=(n-weekend)*250; printf("%d\n",s); return 0; }
by 奈落水易 @ 2019-03-02 17:21:33


额。。。为什么还是这样
by 奈落水易 @ 2019-03-02 17:22:18


```cpp ```cpp ``` ``` 是这么弄的
by Eason_AC @ 2019-03-02 17:29:57


#include<stdio.h> struct week {int num; struct week *next; }day[7]; int main() {int i,x,n,weekend=0,s; struct week *p=&day[x-1]; for(i=0;i<7;i++) {if(i==6){day[i].next=&day [0];day[i].num=7;break;} day[i].next=&day[i+1]; day[i].num=i+1; } scanf("%d %d",&x,&n); for(i=1;i<=n;i++) {if(p->num==6||p->num==7)weekend++; p=p->next; } s=(n-weekend)*250; printf("%d\n",s); return 0; }
by 奈落水易 @ 2019-03-02 17:30:16


| 下一页