commit 31e75df5408af582efb04592fca331910e91de97 Author: 2228628942@qq.com <2228628942@qq.com> Date: Fri Jan 4 13:51:24 2019 +0800 first commit diff --git a/条件运算符.c b/条件运算符.c new file mode 100644 index 0000000..584327f --- /dev/null +++ b/条件运算符.c @@ -0,0 +1,18 @@ +#include +int main(void) +{/* + int a = 40; + a >= 60 ? printf("") : printf("");*/ +// if:else䣻 + + int a = 40; + if (a >= 60 && a <= 100) + { + printf(""); + } + else + { + printf(""); + } + return 0; +} \ No newline at end of file diff --git a/递归.c b/递归.c new file mode 100644 index 0000000..fdd16c2 --- /dev/null +++ b/递归.c @@ -0,0 +1,20 @@ +#include +void solve(int n) { + int temp = n % 10; + /*********Begin*********/ + n /= 10; + if (n > 0) solve(n); + /*********End**********/ + if (n) + printf(" %d", temp); + else + printf("%d", temp); +} +int main(void) +{ + //freopen("in.txt","r",stdin); + int n; + scanf("%d", &n); + solve(n); + return 0; +} \ No newline at end of file