#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main() {
int mark[52];
int num[52];
for(int i=0;i<52;i++){
if(0<=i&&i<13) mark[i]=0;
else if(13<=i&&i<26) mark[i]=1;
else if(26<=i&&i<39) mark[i]=2;
else if(39<=i&&i<52) mark[i]=3;
num[i]=i%13+1;
}
int a,b;
srand((unsigned int)time(NULL));
for(int i=0;i<312;i++){
a=rand()%52;
b=rand()%52;
int tmp;
tmp=mark[a];
mark[a]=mark[b];
mark[b]=tmp;
tmp=num[a];
num[a]=num[b];
num[b]=tmp;
}
if(mark[0]==0) printf("一枚目は♡の%d",num[0]);
else if(mark[0]==1) printf("一枚目は♤の%d",num[0]);
else if(mark[0]==2) printf("一枚目は♢の%d",num[0]);
else if(mark[0]==3) printf("一枚目は♧の%d",num[0]);
}
To embed this project on your website, copy the following code and paste it into your website's HTML: