简体   繁体   English

我在下面所做的编码的“性别”部分应该有什么变化?

[英]What should be change in the “gender” part of the coding I have done below?

In the code below keeps on looping where entering 1 will lead in the void main() function and inside it, there is "gender" information.在下面的代码中不断循环输入1将导致void main() function 并在其中包含“性别”信息。 However, the gender output always got skipped over right after I type the date.但是,性别 output 总是在我输入日期后立即被跳过。

The "Enter your gender(Male/Female): " part got skipped "Enter your gender(Male/Female): "部分被跳过

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void entry() {
    FILE *fpointer;
    char name[20], gender[20], op, option;
    int visit_ID, phone_number, service_needed, change_service, date;
    float service_fee, payment_made, changes, change_service_fee;

    printf("\n\nEnter information:\n");
    printf("\nEnter name: ");
    scanf("%s", name);
    printf("\n\nEnter your ID number(Number only): ");
    scanf("%d", &visit_ID);
    printf("\n\nEnter today date in dd-mm-yy: ");
    scanf("%d", &date);
    printf("\n\nEnter your gender(Male/Female): ");
    scanf("%s", &gender);
    printf("\n\nEnter your phone number: ");
    scanf("%d", &phone_number);
    printf("\n\nDone registered\n\n");

    if ((fpointer = fopen("visitdetails.txt", "a")) == NULL) {
        perror("Write");
        exit(1);
    }
    fprintf(fpointer, "Visit ID = %d", visit_ID);
    fprintf(fpointer, "\nCustomer name = %s", name);
    fprintf(fpointer, "\nLast visit date : %d", date);
    fprintf(fpointer, "\nLast Service type repaired: %d", service_needed);
    fscanf(fpointer, "%d", service_needed);
    fprintf(fpointer, "\nLast Service fee: %.2f", service_fee);
    fprintf(fpointer, "\nLast payment: %.2f", payment_made);
    printf("\n\nRecord Written Successfully\n\n!!!");
    fclose(fpointer);
}

void Repair() {
    char name[20], gender[20], op, option;
    int visit_ID, phone_number, service_needed, date;
    float service_fee, payment_made, changes, change_service_fee;
    FILE *Welcome;

    Welcome = fopen("visitdetails.txt", "r");
    printf("\nWhich service type do you need(1-8)? ");
    scanf("%d", &service_needed);

    switch (service_needed) {
      case 1:
        printf("\nThe cost of it will be 30RM for Normal and 50RM for Urgent(type the cost): ");
        scanf("%f", &service_fee);
        break;

      case 2:
        printf("\nThe cost of it will be 40RM for Normal and 70RM for Urgent(type the cost): ");
        scanf("%f", &service_fee);
        break;

      case 3:
        printf("\nThe cost of it will be 330RM for Normal and 430RM for Urgent(type the cost): ");
        scanf("%f", &service_fee);
        break;

      case 4:
        printf("\nThe cost of it will be 160RM for Normal and 200RM for Urgent(type the cost): ");
        scanf("%f", &service_fee);
        break;

      case 5:
        printf("\nThe cost of it will be 180RM for Normal and 210RM for Urgent(type the cost): ");
        scanf("%f", &service_fee);
        break;

      case 6:
        printf("\nThe cost of it will be 50RM for Normal and 80RM for Urgent(type the cost): ", service_fee);
        scanf("%f", &service_fee);
        break;

      case 7:
        printf("\nThe cost of it will be 100RM for Normal and 150RM for Urgent(type the cost): ", service_fee);
        scanf("%f", &service_fee);
        break;

      case 8:
        printf("\nThe cost of it will be 50RM for Normal and 75RM for Urgent(type the cost): ", service_fee);
        scanf("%f", &service_fee);
        break;

      default:
        printf("Invalid option");
    }

    printf("\n\nPayment: ", payment_made);
    scanf("%f", &payment_made);

    if (payment_made > service_fee) {
        changes = payment_made - service_fee;
        printf("\nHere is your changes :%.2f\n", changes);
    }
    fclose(Welcome);
}

void Viewing_Store() {
    FILE *view;
    view = fopen("visitdetails.txt", "r");

    printf("No |    Service Type                                    | Needed Days | Service Fee | \n");
    printf("                                                                      |Normal|Urgent|\n");
    printf("1. | Remove virus,Malware, or Spyware                   |      2      | 30RM | 50RM |\n");
    printf("2. | Troubleshot and fix computer running slow          |      2      | 40RM | 70RM |\n");
    printf("3. | Laptop Screen Replacement                          |      3      | 330RM| 430RM|\n");
    printf("4. | Laptop Keyboard Replacement                        |      2      | 160RM| 200RM|\n");
    printf("5. | Laptop Battery Replacement                         |      1      | 180RM| 210RM|\n");
    printf("6. | Operating System Format and Installation           |      2      | 50RM | 80RM |\n");
    printf("7. | Data Backup and Recovery                           |      2      | 100RM| 150RM|\n");
    printf("8. | Internet Connectivity issues                       |      1      | 50RM | 75RM |\n");

    fclose(view);
}

void change_type() {
    FILE *change;
    char name[20], gender[20], op, option;
    int visit_ID, phone_number, service_needed, change_service, date;
    float service_fee, payment_made, changes, change_service_fee;

    change = fopen("visitdetails.txt", "r");
    printf("\nAre you sure you want to change the service type into(Y/N) : ", op);
    scanf("%s", &op);
    if (op == 'Y') {
        printf("\nWhat service type do you want to change into(1-8)? ", change_service);
        scanf("%d", &change_service);
        switch (change_service) {
          case 1:
            printf("\nThe cost of it will be 30RM for Normal and 50RM for Urgent(type the cost): ", change_service_fee);
            scanf("%f", &change_service_fee);
            break;

          case 2:
            printf("\nThe cost of it will be 40RM for Normal and 70RM for Urgent(type the cost): ", change_service_fee);
            scanf("%f", &change_service_fee);
            break;

          case 3:
            printf("\nThe cost of it will be 330RM for Normal and 430RM for Urgent(type the cost): ", change_service_fee);
            scanf("%f", &change_service_fee);
            break;

          case 4:
            printf("\nThe cost of it will be 160RM for Normal and 200RM for Urgent(type the cost): ", change_service_fee);
            scanf("%f", &change_service_fee);
            break;

          case 5:
            printf("\nThe cost of it will be 180RM for Normal and 210RM for Urgent(type the cost): ", change_service_fee);
            scanf("%f", &change_service_fee);
            break;

          case 6:
            printf("\nThe cost of it will be 50RM for Normal and 80RM for Urgent(type the cost): ", change_service_fee);
            scanf("%f", &change_service_fee);
            break;

          case 7:
            printf("\nThe cost of it will be 100RM for Normal and 150RM for Urgent(type the cost): ", change_service_fee);
            scanf("%f", &change_service_fee);
            break;

          case 8:
            printf("\nThe cost of it will be 50RM for Normal and 75RM for Urgent(type the cost): ", change_service_fee);
            scanf("%f", &change_service_fee);
            break;

          default:
            printf("Invalid option");
        }
    } else
    if (op == 'N') {
        printf("\nThe final price will be : %.2f", service_fee);
    }

    printf("\n\nPayment: ", payment_made);
    scanf("%f", &payment_made);

    if (payment_made > service_fee) {
        changes = payment_made - service_fee;
        printf("\nHere is your changes :%.2f\n", changes);
    } else
    if (payment_made > change_service_fee) {
        changes = payment_made - change_service_fee;
        printf("\nHere is your changes: %.2f\n", changes);
    } else
    if (payment_made == service_fee) {
        changes = payment_made - service_fee;
        printf("\nHere is your changes %f\n", changes);
    } else
    if (payment_made == change_service_fee) {
        changes = payment_made - change_service_fee;
        printf("\nHere is your changes: %f\n", changes);
    } else {
        printf("Error");
    }

    fprintf(change, "\n\nChanging service type into: %d", change_service);
    fprintf(change, "\nThe price of this service type is: %f", change_service_fee);
    fprintf(change,"\nPayment: %.2f", payment_made);
    fclose(change);
}

void any_visit(char anv[]) {
    FILE *anyvisit;
    char name[200], gender[20];
    int visit_ID, phone_number, service_needed, change_service, date, set;
    float service_fee, payment_made, changes, change_service_fee;

    anyvisit = fopen("visitdetails.txt","r");
    while (fscanf(any_visit, "%s %d %d %s %d %d\n", name, visit_ID, date, gender, phone_number, payment_made) != EOF) {
        set = strcmp(date, anv);
        if (set == 0) {
            printf("Visit_ID is %d", visit_ID);
            printf("\nName : %s", name);
            printf("\nGender is %s", gender);
            printf("\nPhone number is %d", phone_number);
            printf("\nPayment : %.2f", payment_made);
        }
    }
    fclose(anyvisit);
}

void search(char cnm[]) {
    FILE *search;
    char name[200], gender[20];
    int visit_ID, phone_number, service_needed, change_service, date, tes;
    float service_fee, payment_made, changes, change_service_fee;

    search = fopen("visitdetails.txt","r");
    while (fscanf(search, "%s %d %d %s %d %d\n", name, visit_ID, date, gender, phone_number, payment_made) != EOF) {
        tes = strcmp(name, cnm);
        if (tes == 0) {
            printf("Visit_ID is %d", visit_ID);
            printf("Date of visit is %d", date);
            printf("\nGender is %s", gender);
            printf("\nPhone number is %d", phone_number);
            printf("\nPayment: %d", date);
        }
    }
    fclose(search);
}

void main() {
    char name[200], gender[20], op, option, ch, cnm[30], anv[30];
    int visit_ID, phone_number, service_needed, change_service, date;
    float service_fee, payment_made, changes, change_service_fee;

    printf("*****Welcome to the Computer center*****\n");
    printf("\nBefore entering the store and have your equipment repair, it is best to view the store\n");
    do {
        printf("\nPress '1' to enter and have your data store");
        printf("\nPress '2' to View the store");
        printf("\nPress '3' to have your equipment being repaired");
        printf("\nPress '4' if you want to change your repair type");
        printf("\nPress '5' if you want to Search");
        printf("\nPress '6' if you want to search payment and unpaid balance by any visit");
        printf("\nPress '0' to exit");
        printf("\nEnter your choice : ");
        scanf("%d", &ch);
        switch(ch) {
          case 1:
            entry();
            break;
          case 2:
            Viewing_Store();
            break;
          case 3: 
            Repair();
            break;
          case 4:
            change_type();
            break;
          case 5:
            printf("Enter your name: ");
            scanf("%s", &cnm);
            search(cnm);
            break;
          case 6:
            printf("Enter the date you visit: ");
            scanf("%d", &anv);
            any_visit(anv);
            break;
          case 0:
            exit(0);
          default:
            printf("\nInvalid Entry!!! ");
        }
    } while (ch != 0);
}

As you mentioned above, We cannot give Gender.正如你上面提到的,我们不能提供性别。 Since you used int datatype for Storing the date, but you asked to give in dd-mm-yy format.由于您使用int数据类型存储日期,但您要求以dd-mm-yy格式提供。

*To prove that give any "number" of int type in this prompt Enter today date in dd-mm-yy: and You can see that the program prompts for the Gender.* *证明在此提示中输入任何“数字” int 类型在dd-mm-yy 中输入今天日期:并且您可以看到程序提示输入性别。*

we cannot store dd-mm-yy this format in int type.我们不能以int类型存储dd-mm-yy这种格式。

so you can do in another ways所以你可以用其他方式做

  1. To store date as Char array OR将日期存储为Char数组
  2. To store day,month,year in individual int variables OR将日、月、年存储在单个int变量中
  3. To use Struct datatype使用Struct数据类型
This is what updated from before, however the search function when pressing '5' and '6' says that segmentation fault but i can't find any wrong code in my coding. Do you mind if you check once more what is the fault @Rohith S







#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void entry()
{
      FILE * fpointer;
      char name[20], gender[20], op, option, date[50];
      int visit_ID, phone_number, service_needed, change_service;
      float service_fee, payment_made, changes, change_service_fee;


      printf("\n\nEnter information:\n");
      printf("\nEnter name: ");
      scanf("%s", name);
      printf("\n\nEnter your ID number(Number only): ");
      scanf("%d", &visit_ID);
      printf("\n\nEnter today date in dd-mm-yy: ");
      scanf("%s" ,&date);
      printf("\n\nEnter your gender(Male/Female): ");
      scanf("%s",gender);
      printf("\n\nEnter your phone number: ");
      scanf("%d", &phone_number);
      printf("\n\nDone registered\n\n");

      if((fpointer = fopen("visitdetails.txt", "a")) == NULL)
        {
          perror("Write");
              exit(1);
        }
      fprintf(fpointer, "Visit ID = %d", visit_ID);
      fprintf(fpointer, "\nCustomer name = %s", name);
      fprintf(fpointer, "\nLast visit date : %s", date);
      fprintf(fpointer,"\nLast Service type repaired: %d", service_needed);
      fscanf(fpointer,"%d",service_needed);
      fprintf(fpointer, "\nLast Service fee: %.2f",service_fee);
      fprintf(fpointer,"\nLast payment: %.2f",payment_made);
      printf("\n\nRecord Written Successfully!!!\n\n");
      fclose(fpointer);
}
void Repair()
{
      char name[20], gender[20], op, option, date[50];
      int visit_ID, phone_number,service_needed;
      float service_fee, payment_made, changes, change_service_fee;

      FILE *Welcome;
      Welcome = fopen("visitdetails.txt","r");
          printf("\nWhich service type do you need(1-8)? ");
          scanf("%d", &service_needed);

          switch(service_needed)
          {
            case 1:
                printf("\nThe cost of it will be 30RM for Normal and 50RM for Urgent(type the cost): ");
                scanf("%f", &service_fee);
                break;

            case 2:
                printf("\nThe cost of it will be 40RM for Normal and 70RM for Urgent(type the cost): ");
                scanf("%f", &service_fee);
                break;

            case 3:
                printf("\nThe cost of it will be 330RM for Normal and 430RM for Urgent(type the cost): ");
                scanf("%f", &service_fee);
                break;

            case 4:
                printf("\nThe cost of it will be 160RM for Normal and 200RM for Urgent(type the cost): ");
                scanf("%f", &service_fee);
                break;

            case 5:
                printf("\nThe cost of it will be 180RM for Normal and 210RM for Urgent(type the cost): ");
                scanf("%f",&service_fee);
                break;

            case 6:
                printf("\nThe cost of it will be 50RM for Normal and 80RM for Urgent(type the cost): ",service_fee);
                scanf("%f",&service_fee);
            break;

            case 7:
                printf("\nThe cost of it will be 100RM for Normal and 150RM for Urgent(type the cost): ",service_fee);
                scanf("%f",&service_fee);
            break;

            case 8:
                printf("\nThe cost of it will be 50RM for Normal and 75RM for Urgent(type the cost): ",service_fee);
                scanf("%f",&service_fee);
            break;

            default:
            printf("Invalid option");
          }

          printf("\n\nPayment: ", payment_made);
          scanf("%f",&payment_made);

          if(payment_made > service_fee)
          {
            changes = payment_made - service_fee;
            printf("\nHere is your changes :%.2f\n", changes);
          }
            fclose(Welcome);
}
void Viewing_Store()
{
  FILE *view;
  view = fopen("visitdetails.txt","r");

  printf("No |    Service Type                                    | Needed Days | Service Fee | \n");
  printf("                                                                      |Normal|Urgent|\n");
  printf("1. | Remove virus,Malware, or Spyware                   |      2      | 30RM | 50RM |\n");
  printf("2. | Troubleshot and fix computer running slow          |      2      | 40RM | 70RM |\n");
  printf("3. | Laptop Screen Replacement                          |      3      | 330RM| 430RM|\n");
  printf("4. | Laptop Keyboard Replacement                        |      2      | 160RM| 200RM|\n");
  printf("5. | Laptop Battery Replacement                         |      1      | 180RM| 210RM|\n");
  printf("6. | Operating System Format and Installation           |      2      | 50RM | 80RM |\n");
  printf("7. | Data Backup and Recovery                           |      2      | 100RM| 150RM|\n");
  printf("8. | Internet Connectivity issues                       |      1      | 50RM | 75RM |\n");


  fclose(view);
}
void change_type()
{
  FILE *change;
  char name[20], gender[20], op, option, date[50];
  int visit_ID, phone_number, service_needed, change_service;
  float service_fee, payment_made, changes, change_service_fee;

      change = fopen("visitdetails.txt","r");
      printf("\nAre you sure you want to change the service type into(Y/N) : ", op);
      scanf("%s", &op);
      if(op == 'Y')
      {
        printf("\nWhat service type do you want to change into(1-8)? ", change_service);
        scanf("%d", &change_service);
        switch(change_service)
        {
          case 1:
          printf("\nThe cost of it will be 30RM for Normal and 50RM for Urgent(type the cost): ",change_service_fee);
          scanf("%f",&change_service_fee);
          break;

          case 2:
          printf("\nThe cost of it will be 40RM for Normal and 70RM for Urgent(type the cost): ",change_service_fee);
          scanf("%f",&change_service_fee);
          break;

          case 3:
          printf("\nThe cost of it will be 330RM for Normal and 430RM for Urgent(type the cost): ",change_service_fee);
          scanf("%f",&change_service_fee);
          break;

          case 4:
          printf("\nThe cost of it will be 160RM for Normal and 200RM for Urgent(type the cost): ",change_service_fee);
          scanf("%f",&change_service_fee);
          break;

          case 5:
          printf("\nThe cost of it will be 180RM for Normal and 210RM for Urgent(type the cost): ",change_service_fee);
          scanf("%f",&change_service_fee);
          break;

          case 6:
          printf("\nThe cost of it will be 50RM for Normal and 80RM for Urgent(type the cost): ",change_service_fee);
          scanf("%f",&change_service_fee);
          break;

          case 7:
          printf("\nThe cost of it will be 100RM for Normal and 150RM for Urgent(type the cost): ",change_service_fee);
          scanf("%f",&change_service_fee);
          break;

          case 8:
          printf("\nThe cost of it will be 50RM for Normal and 75RM for Urgent(type the cost): ",change_service_fee);
          scanf("%f",&change_service_fee);
          break;

          default:
          printf("Invalid option");
        }
      }
      else if (op == 'N')
      {
        printf("\nThe final price will be : %.2f", service_fee);
      }

      printf("\n\nPayment: ", payment_made);
      scanf("%f",&payment_made);

      if(payment_made > service_fee)
      {
        changes = payment_made - service_fee;
        printf("\nHere is your changes :%.2f\n", changes);
      }
      else if(payment_made > change_service_fee)
      {
        changes = payment_made - change_service_fee;
        printf("\nHere is your changes: %.2f\n", changes);
      }
      else if(payment_made == service_fee)
      {
        changes = payment_made - service_fee;
        printf("\nHere is your changes %f\n", changes);
      }
      else if(payment_made == change_service_fee)
      {
        changes = payment_made - change_service_fee;
        printf("\nHere is your changes: %f\n", changes);
      }
      else
      {
        printf("Error");
      }

      fprintf(change, "\n\nChanging service type into: %d", change_service);
      fprintf(change, "\nThe price of this service type is: %f", change_service_fee);
      fprintf(change,"\nPayment: %.2f",payment_made);
      fclose(change);
}
void any_visit(char anv[])
{
  FILE *anyvisit;

  char name[200], gender[20],date[50];
  int visit_ID, phone_number, service_needed, change_service, set;
  float service_fee, payment_made, changes, change_service_fee;

  anyvisit = fopen("visitdetails.txt","r");
  while(fscanf(any_visit, "%s %d %s %s %d %d\n", name, visit_ID, date, gender, phone_number, payment_made) !=EOF)
  {
    set = strcmp(date, anv);
    if(set == 0)
    {
      printf("Visit_ID is %d", visit_ID);
      printf("\nName : %s", name);
      printf("\nGender is %s", gender);
      printf("\nPhone number is %d", phone_number);
      printf("\nPayment : %.2f", payment_made);
    }
  }
  fclose(anyvisit);
}
void search(char cnm[])
{
  FILE *search;

  char name[200], gender[20],date[50];
  int visit_ID, phone_number, service_needed, change_service,tes;
  float service_fee, payment_made, changes, change_service_fee;

  search = fopen("visitdetails.txt","r");
  while(fscanf(search, "%s %d %s %s %d %d\n", name, visit_ID, date, gender, phone_number, payment_made) !=EOF)
  {
    tes = strcmp(name, cnm);
    if (tes == 0)
    {
      printf("Visit_ID is %d", visit_ID);
      printf("Date of visit is %s", date);
      printf("\nGender is %s", gender);
      printf("\nPhone number is %d", phone_number);
      printf("\nPayment: %d", payment_made);
    }
  }
  fclose(search);
}

void main()
{
  char name[200], gender[20], op, option, ch, cnm[30], anv[30],date[50];
  int visit_ID, phone_number, service_needed, change_service;
  float service_fee, payment_made, changes, change_service_fee;

  printf("*****Welcome to the Computer center*****\n");
  printf("\nBefore entering the store and have your equipment repair, it is best to view the store\n");
  do
  {
  printf("\nPress '1' to enter and have your data store");
  printf("\nPress '2' to View the store");
  printf("\nPress '3' to have your equipment being repaired");
  printf("\nPress '4' if you want to change your repair type");
  printf("\nPress '5' if you want to Search");
  printf("\nPress '6' if you want to search payment and unpaid balance by any visit");
  printf("\nPress '0' to exit");
  printf("\nEnter your choice : ");
  scanf("%d",&ch);
    switch(ch)
    {
    case 1: entry();
        break;
    case 2: Viewing_Store();
        break;
    case 3: Repair();
        break;
    case 4:change_type();
        break;
    case 5: printf("Enter your name: ");
            scanf("%s", &cnm);
            search(cnm);
        break;
    case 6: printf("Enter the date you visit: ");
            scanf("%d", &anv);
            any_visit(anv);
        break;
    case 0: exit(0);
    default: printf("\nInvalid Entry!!! ");
    }
  } while(ch != 0);
}

There are some issues in the posted code:发布的代码中存在一些问题:

  • scanf("%s", &gender); should be scanf("%19s", gender);应该是scanf("%19s", gender);
  • why do you read from fpointer in fscanf(fpointer, "%d", service_needed);为什么你从 fscanf( fpointer fscanf(fpointer, "%d", service_needed); ? ?
  • strcmp(date, anv); is invalid as date is an int .无效,因为dateint
  • scanf("%s", &op) is incorrect as op is a single char . scanf("%s", &op)不正确,因为op是单个char You cannot store a string into it.您不能将字符串存储到其中。 use scanf(" %c", &op) (with an initial space to skip the pending newline).使用scanf(" %c", &op) (带有初始空格以跳过挂起的换行符)。
  • it is risky to store phone numbers as integers, some may exceed the range of type int and the initial 0 will be lost.将电话号码存储为整数是有风险的,有些可能会超出int类型的范围,初始0会丢失。 Use a string for that.为此使用字符串。
  • the contents you write to visitdetails.txt is inconsistent with the way you read from this database.您写入visitdetails.txt的内容与您从该数据库读取的方式不一致。 You should just use:你应该只使用:

     printf(any_visit, "%s %d %d %s %d %.2f\n", name, visit_ID, date, gender, phone_number, payment_made);
  • main has a return type of int . main的返回类型为int

There are many more mistakes in the code, compiling with warnings enabled, I get 106 warnings and 1 error .代码中还有很多错误,在启用警告的情况下编译,我得到106 个警告1 个错误

You should enable all warnings and let the compiler help you avoid type mismatches and similar bugs: use gcc -Wall -Wextra -Werror and fix all these warnings.您应该启用所有警告并让编译器帮助您避免类型不匹配和类似错误:使用gcc -Wall -Wextra -Werror并修复所有这些警告。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在这里做错了什么? - What have I done wrong here? 当我尝试使数组溢出时,gcc做了什么? - what have gcc done when I try to make a array overflow? 我做了什么? 指针指针指向双精度指针? - What have I done? pointer to pointer to pointer to double? 我应该在'gamma' function 中更改什么? - What should I change in the 'gamma' function? 我应该从这段代码中改变什么 - what thing i should change from this code 从 C 套接字发送和接收数据的安全编码。 我应该进行哪些检查? - Secure coding on send and receive data from C sockets. What kind of checks should I perform? 我应该如何继续执行此代码? 我应该在此作业的第二部分使用哪个关键字? - How should I continue this code? What keyword should I use for the 2nd part of this assignment? RLE 编码,如何计算在 RLE 完成其部分后我有多少个符号? - RLE encoding, how do I figure out how many symbols do I have after RLE has done its part? 下面我的 C 选择排序代码有什么问题? 我应该在我的无效选择排序中做什么 - What is wrong with my C selection sort code below? what should I do in my void selection sort 使用堆栈将中缀表达式转换为前缀时,如果扫描的操作符和栈顶操作符具有相同的优先级,应该怎么做? - When converting an infix expression to prefix using stacks, if the scanned and top of the stack operators have same precedence, what should be done?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM