0
New drivers license (code coach) test case 5 not passed Why. C LANGUAGE
#include <stdio.h> #include <string.h> int main() { char arr[20]; char arr2[50]; int num; scanf("%s\n %d\n",arr,&num); fgets(arr2,sizeof(arr2), stdin); int s= strlen(arr2); int min = 20; int plus =0; int d; for(int i=0; i<s; i++){ if(arr2[i] >= 'A' && arr2[i] <= 'Z'){ if(arr[0] > arr2[i] && num == 1){ plus += 20; } } } d= min + (plus/num); printf ("%d", d); return 0; }
4 Answers
0
for(int i=0; i<s; i++){
if(arr2[i] >= 'A' && arr2[i] <= 'Z'){
if(arr[0] > arr2[i] && num == 1){
plus += 20;
}else if(arr[0] > arr2[i] && num == 3){
plus += 20;
}
}
}
+ 1
Bhai it works in all cases
0
Thank you Bahha