⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testlen4.c

📁 [Game.Programming].Academic - Graphics Gems (6 books source code)
💻 C
字号:
/* * testlen4.c - len4 exerciser * * % cc -g testlen4.c len4.c -lm -o testlen4 * % ./testlen4 2 1 1 1  * % ./testlen4 60000000 25000000 19000000 16000000 */#include <stdio.h>#include <stdlib.h>	/* for atoi() */#include <math.h>main(argc, argv)    char *argv[];    {    long a, b, c, d, l;    double l2;    a = atoi(argv[1]);    b = atoi(argv[2]);    c = atoi(argv[3]);    d = atoi(argv[4]);    l = len4(a,b,c,d);    l2 = hypot(hypot((double)(a),(double)(b)),	       hypot((double)(c),(double)(d)));    printf("(%d,%d,%d,%d) = %d (%g)\n", a, b, c, d, l, l/l2);    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -