用c语言实现车牌号的任意选取 急求解啊

用c语言实现车牌号的任意选取 急求解啊,第1张

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

void main(){

char id[6]={'\0'}

char arr[36]={'0','1','2','3'橡碰,'碰如昌4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K',

'L','M','N','O','P'笑扒,'Q','R','S','T','U','V','W','X','Y','Z'}

srand((unsigned)time(NULL))

int a

for (int i=0i<5i++)

{

a=rand()%36

id[i]=arr[a]

}

printf("随机车牌号为:%s\n",id)

}

struct BITS  fun(int  n)

{

    struct BITS  res

    

   型羡 res.m3=n/1000

    胡虚res.m2=n/100%10

    res.m1=n/10%10

 卜做拍   res.m0=n%10

    return res

}

#include <stdio.h>

void main()

{

int n

int a

int x1, x2, x3, x4

for (n=32n<99n++)

{

a=n*n

x1=a/1000

x2=a%1000/100

x3=a%100/10

x4=a%10

if (x1==x2&&x3==x4&&x1!=x3)

{

printf("the number is:%d^2=%d\n", n, a)

break

}

}

}


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12508865.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存