崩铁吧 关注:7,238贴子:9,674
  • 9回复贴,共1
#include <stdio.h>
int main() {
int num;
scanf("%d", &num);
if(num % 2 == 1)
printf("odd\n");
else
printf("even\n");
return 0;
}


IP属地:陕西来自Android客户端1楼2025-03-12 15:01回复
    #include <stdio.h>
    int main() {
    char ch;
    scanf("%c", &ch);
    if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {
    printf("\n");
    } else if (ch >= '0' && ch <= '9') {
    printf("\n");
    } else {
    printf("\n");
    }
    return 0;
    }


    IP属地:陕西来自Android客户端2楼2025-03-12 15:09
    回复
      #include <stdio.h>
      int main() {
      int a, b, c;
      scanf("%d %d %d", &a, &b, &c);
      if (a < b) {
      int t = a;
      a = b;
      b = t;
      }
      if (a < c) {
      int t = a;
      a = c;
      c = t;
      }
      if (b < c) {
      int t = b;
      b = c;
      c = t;
      }
      printf("%d,%d,%d\n", a, b, c);
      return 0;
      }


      IP属地:陕西来自Android客户端3楼2025-03-12 15:12
      回复
        #include <iostream>
        #include <cctype>
        using namespace std;
        int main() {
        char ch;
        cin >> ch;
        if (isalpha(ch)) {
        cout << "字母" << endl;
        } else if (isdigit(ch)) {
        cout << "数字" << endl;
        } else {
        cout << "其他字符" << endl;
        }
        return 0;
        }


        IP属地:陕西来自Android客户端4楼2025-03-12 15:14
        回复
          #include <iostream>
          #include <cctype>
          using namespace std;
          int main() {
          char ch;
          cin >> ch;
          if (isalpha(ch)) {
          cout << "字母" << endl;
          } else if (isdigit(ch)) {
          cout << "数字" << endl;
          } else {
          cout << "其他字符" << endl;
          }
          return 0;
          }


          IP属地:陕西来自Android客户端5楼2025-03-12 15:15
          回复
            #include <stdio.h>
            int main() {
            int num1, num2, num3;
            scanf("%d %d %d", &num1, &num2, &num3);
            if (num1 < num2) {
            int temp = num1;
            num1 = num2;
            num2 = temp;
            }
            if (num1 < num3) {
            int temp = num1;
            num1 = num3;
            num3 = temp;
            }
            if (num2 < num3) {
            int temp = num2;
            num2 = num3;
            num3 = temp;
            }
            printf("%d,%d,%d\n", num1, num2, num3);
            return 0;
            }


            IP属地:陕西来自Android客户端6楼2025-03-12 15:18
            回复
              #include <stdio.h>
              int main() {
              float s;
              scanf("%f", &s);
              if(s<0||s>100) printf("成绩超出了范围\n");
              else if(s<60) printf("不及格\n");
              else if(s<70) printf("中等\n");
              else if(s<85) printf("良好\n");
              else printf("优秀\n");
              return 0;
              }


              IP属地:陕西来自Android客户端7楼2025-03-12 15:20
              回复
                #include <stdio.h>
                int main() {
                int a, b;
                char op;
                scanf("%d%c%d", &a, &op, &b);
                if(op == '+') printf("%d\n", a + b);
                else if(op == '-') printf("%d\n", a - b);
                else if(op == '*') printf("%d\n", a * b);
                else if(op == '/') {
                if(b != 0) printf("%d\n", a / b);
                else printf("Division by zero error!\n");
                }
                else printf("Invalid operator!\n");
                return 0;
                }


                IP属地:陕西来自Android客户端8楼2025-03-12 15:22
                回复
                  #include <stdio.h>
                  int main() {
                  float x, y;
                  scanf("%f %f", &x, &y);
                  float d = (x - 1)*(x - 1)+(y - 1)*(y - 1);
                  if(d < 1) printf("单位圆内\n");
                  else if(d == 1) printf("单位圆上\n");
                  else printf("单位圆外\n");
                  return 0;
                  }


                  IP属地:陕西来自Android客户端9楼2025-03-12 15:25
                  回复
                    #include <stdio.h>
                    #include <math.h>
                    int main() {
                    int x;
                    double result;
                    scanf("%d", &x);
                    if(x>20) result = 1.0/x + fabs(x);
                    else if(x>=10 && x<=20) result = sqrt(3*x)-2;
                    else result = x*x + 3*x + 2;
                    printf("%.2f\n", result);
                    return 0;
                    }


                    IP属地:陕西来自Android客户端10楼2025-03-12 15:29
                    回复