用户输入数字时,对值进行计数并再次返回到代码的开头

时间:2018-12-15 15:18:02

标签: c

在程序计数使用了什么输入后,它将打印出该值,然后程序将询问是否继续,如果我按“ Y”,则当用户输入数字时,程序将从头开始。问题是,如果用户按“ Y”,如何使程序重新开始?

#include <stdio.h>
#include <stdlib.h>
void VOne();
int main(void) {
  VOne();
  return 0;
}

void VOne() {
  int i,quiz,exer,test,Final,FV,back;
  char again;
  while (1) {

    printf("Input Value : ");
    scanf("%d %d %d %d",&quiz,&exer,&test,&Final );
    FV = 0.10+(0.10*quiz)+(0.15*exer)+(0.30*test)+(0.35*Final);
    printf("%d\n",FV );
    if (FV >= 75) {
      printf("You pass the this class\n" );
    }
    else {
      printf("You've to take this class again in the next term\n");
    }
    printf("You want to input again?\n'Y'or'N\n");
    scanf("%c ",&again );
    if (again == 'y') {
      continue;
    }
  }
  return;
}

1 个答案:

答案 0 :(得分:1)

这应该有效。

var client = db.Client.Include("whatever you need").WhereDeleted().Where(c => c.Age < 30);