|
|
What data it is? I didn't check that p[9] == 10 when p[8] == 10, where p[1]...p[10] - points Edited by author 28.11.2023 11:41 Как узнать, когда игрок сделал страйк или спэр, если количество бросков во фрейме не задано? My code: #include <stdio.h> #include <stdlib.h> int main() { int n,i,len,max=0,min=0; int ball[10]; len=sizeof(ball)/sizeof(int); for(i=0;i<len;i++){ scanf("%d",&ball[i]); min+=ball[i]; } for(i=0;i<len;i++){ n=ball[i]; max+=n; if((n==10)&& (ball[i+1]==10) && (i+1<len)){ max+=ball[i+1]; max+=ball[i+2]; } else if((n==10) && (ball[i+1]<10) && (i+1<len)) max+=ball[i+1]; else if((i+1==len) && (n==10))max+=20; } printf("%d %d",min,max); return 0; } Wrong answer in test №17 нужной найти максимум и минимум Help me: Wrong answer in test #6 Wrong answer in test №20, help Edited by author 10.03.2022 01:08 0 0 0 0 0 0 0 0 10 17 check this Wrong answer in test №17 Me too. Who knows how to resolve this problem? 0 0 0 0 0 0 0 0 10 30 Answer: 50 60 0 0 0 0 0 0 0 10 10 30 Answer: 60 90 0 0 0 0 0 0 0 10 10 21 Answer: 51 81 0 0 0 0 0 0 0 10 10 20 Answer: 40 80 Edited by author 11.07.2016 13:21 >> 0 0 0 0 0 0 0 10 10 21 : min = 51 - how ?? last frame: [ 10 , 10 , 1 ]-> gets min=51, but last frame: [ 1 , 10 , 10 ] - > gets min = 42 --> why this is not possible? [ 1 , 10 , 10 ] is not possible because there are only 9 pins after the first roll here. So you cannot knock down 10 pins in the second roll. |
|
|