CAD技术 华东师范大学《CAD技术》考试作品提交三维建模题的模型文件和编程题的工程文件

《CAD技术》考试作品提交三维建模题的模型文件和编程题的工程文件
要求:1、只要提交三维建模题的.dwg文件和编程题的.dvb文件2、请注意题目要求,编程题部分必须通过编程实现,三维建模不能通过其他工具实现,否则不得分!!!3、AutoCAD系统要求选用AutoCAD 2005及以前版本(有AutoCAD 2002、AutoCAD 2004)。做好之后麻烦发送到邮箱:[email protected],有重谢!!!!

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

int fun(int x, int y)
{
//求两个数的最大公约数
int z;
z = x % y;
while (z != 0)
{
x = y;
y = z;
z = x % y;
}
return y;
}

int main(void)
{
int a[10], i, j, z = 1;
srand(time(NULL));
for (j = 0; j < 5; j++)
{
for (i = 0; i < 10; i++)
{
a[i] = rand() % 90 + 10;
printf("%d ", a[i]);
}
putchar('\n');
for (i = 0; i < 10; i++)
z = fun(z, a[i]);
printf("最大公约数: %d\n\n", z);
z=1;
}
return 0;
}
温馨提示:答案为网友推荐,仅供参考