码迷,mamicode.com
首页 > 其他好文 > 详细

心理魔术

时间:2019-03-23 15:55:01      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:you   unsigned   nbsp   info   cat   time   getc   stdio.h   ica   

// 心理魔术.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;
}

技术图片

 

心理魔术

标签:you   unsigned   nbsp   info   cat   time   getc   stdio.h   ica   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!