Menu
CoddyTech

回顾:入学规则

Coddy 面向 Rust 开发者的 C 课程的第 11 课,共 48 课。

challenge icon

挑战

中等

输入是年龄和票务整数。仅当年龄至少为 12 且票务恰好为 1 时才允许进入。允许进入时返回 1,否则返回 0。

编辑未锁定的源文件和头文件。保持已声明的公共 API 与可见的锁定文件 main.c 兼容,因为它会直接调用该 API。不要添加另一个 main。除非任务明确检查取值范围,否则所有数值任务数据都足够小,不会导致溢出。只打印指定的输出;如果提供了驱动程序,它会负责解析输入和输出。

亲手试试

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include <limits.h>
#include <errno.h>
#include "lesson.h"
int main(void){int a=0,b=0;if(scanf("%d%d",&a,&b)!=2)return 1;printf("%d\n",admit(a,b));return 0;}

面向 Rust 开发者的 C中的所有课

自己练习: C 在线编译器