心理魔术

// 心理魔术.cpp : Defines the entry point for the application.
//

#include "time.h"
#include"stdlib.h"
#include"stdio.h"

int main()
{
int i;
char c,gu;
srand((unsigned)time(NULL));

c=3;
gu=rand()%6+1;
for(i=1;i<=100;i++)
{
c=rand()%19+1;
if(c<=13&&c>=7)
c=5;

if(i%9==0)
printf("%d.%c\t",i,gu);
else
printf("%d.%c\t",i,c);
if(i%5==0)
printf("\n");
}
getchar();
printf("the icon you guess is:%c\n",gu);

return 0;
}

原文地址:https://www.cnblogs.com/P201821430046/p/10584174.html