#include<stdio.h>
#include<ctime>
#include<random>
#include<conio.h>
int times= 5;
int sum = 0;
int a=0;
int b=0;
int c=0;
int d=0;
int e=0;
int main() {
int temp=0;
char n;
while (times-->0) {
a=rand()%101;
b=rand()%101;
c=rand()%101;
d=rand()%101;
e=rand()%101;
systm("cls");
printf("下面有%d个红包,选一个拆开吧", times);
printf(" [A ] [B] [C] [D] [E]\n");
printf("您的选择是: ");
scanf("%c", &n);
getchar();
if(n=='a')
temp=a;
else if(n=='b')
temp=b;
else if(n=='c')
temp=c;
else if(n=='d')
temp=d;
else if(n=='e')
temp=e;
else
temp = 0;
printf("这个红包有%d元\n", temp);
sum += temp;
}
printf("您共拆开%d元红包",sum);
return 0;
}