题解 | 小红喜欢1

小红喜欢1

https://www.nowcoder.com/practice/cbd0c91f821847a4bb1c5115405f6eda

#include <stdio.h>

/*int main() {
    int a, b;
    while (scanf("%d %d", &a, &b) != EOF) { // 注意 while 处理多个 case
        // 64 位输出请用 printf("%lld") to 
        printf("%d\n", a + b);
    }
    return 0;
}
*/
int main()
{
    int arr[5]={0};
    scanf("%d %d %d %d %d",&arr[0],&arr[1],&arr[2],&arr[3],&arr[4]);
    int i = 0;
    while(arr[i]==0)
    {
        if(i<5)
        i++;
    }
    printf("%d",i+1);
    return 0;
}

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务