comparison test/simp1.c @ 249:8313c965c0e2

*** empty log message ***
author kono
date Tue, 11 May 2004 16:50:05 +0900
parents
children 1452eb0eab20
comparison
equal deleted inserted replaced
248:b4a57dd14801 249:8313c965c0e2
1 int
2 i(int a,int b,int c,int d,int f)
3 {
4 return a+b+c+d+f;
5 }
6
7 short
8 s(short a,short b,short c,short d,short f)
9 {
10 return a+b+c+d+f;
11 }
12
13 char
14 c(char a,char b,char c,char d,char f)
15 {
16 return a+b+c+d+f;
17 }
18
19
20 float
21 f(float a,float b,float c,float d,float f)
22 {
23 return a+b+c+d+f;
24 }
25
26 double
27 d(double a,double b,double c,double d,double f)
28 {
29 return a+b+c+d+f;
30 }
31
32 long long
33 l(long long a,long long b,long long c,long long d,long long f)
34 {
35 return a+b+c+d+f;
36 }
37
38
39 int
40 i0()
41 {
42 int a,b,c;
43 a=3;
44 b=-3;
45 c=5;
46 c = i(a*3,b*c,b+c,b/c,b-c);
47 printf("int: %d\n",c);
48 }
49
50 int
51 g()
52 {
53 float a,b,c;
54 a=3.0;
55 b=-3.0;
56 c=5.0;
57 c = f(a*3,b*c,b+c,b/c,b-c);
58 printf("float: %g\n",c);
59 }
60
61 int
62 h()
63 {
64 double a,b,c;
65 a=3.0;
66 b=-3.0;
67 c=5.0;
68 c = d(a*3,b*c,b+c,b/c,b-c);
69 printf("double: %g\n",c);
70 }
71
72 int
73 h1()
74 {
75 long long a,b,c;
76 a=3;
77 b=-3;
78 c=5;
79 c = l(a*3,b*c,b+c,b/c,b-c);
80 printf("long long: %lld\n",c);
81 }
82
83 int
84 c1()
85 {
86 char a,b,c;
87 a=3;
88 b=-3;
89 c=5;
90 c = c(a*3,b*c,b+c,b/c,b-c);
91 printf("char: %d\n",c);
92 }
93
94 int
95 s1()
96 {
97 short a,b,c;
98 a=3;
99 b=-3;
100 c=5;
101 c = s(a*3,b*c,b+c,b/c,b-c);
102 printf("short: %d\n",c);
103 }
104
105 main()
106 {
107 i0();
108 g();
109 h();
110 h1();
111 return 0;
112 }