OIT Archive
C演習I 02
最終更新:
oit-archive
-
view
work21.c
- #include <stdio.h>
-
- int main(void){
-
- double r, c, s;
-
- double pai = 3.14;
-
-
- c = 2 * pai * r ;
- s = pai * r * r;
-
- return 0;
- }
-
work22.c
- #include <stdio.h>
-
- int main(void){
-
- int a1, a2, a3;
- double ave;
-
-
- ave = (double)(a1 + a2 + a3) / 3;
-
- return 0;
- }
-
work23.c
- #include <stdio.h>
-
- int main(void){
-
- double before;
- int after;
-
-
- after = (int)(before);
-
- return 0;
- }
-
work24.c
- #include <stdio.h>
-
- int main(void){
-
- int a, b;
- int tmp;
-
-
- tmp = a;
- a = b;
- b = tmp;
-
- return 0;
- }
-
work25.c
- #include <stdio.h>
-
- int main(void){
-
- int r;
- double s, v;
- double pai = 3.14;
-
-
- s = 4 * pai * r * r;
- v = 4 * pai * r * r * r / 3;
-
- return 0;
- }
-
-
work26.c
- #include <stdio.h>
-
- int main(void){
-
- double speed;
-
-
-
- return 0;
- }
-
work27.c
- #include <stdio.h>
-
- int main(void){
-
- int principal;
- double rate;
-
- rate = rate / 100;
-
- principal = (int)(principal + principal * rate);
- principal = (int)(principal + principal * rate);
- principal = (int)(principal + principal * rate);
-
- return 0;
- }
-
work28.c
- #include <stdio.h>
-
- int main(void){
-
- int a, b, c, tmp;
-
-
-
- tmp = a;
- a = b;
- b = c;
- c = tmp;
- tmp = a;
- a = b;
- b = c;
- c = tmp;
- tmp = a;
- a = b;
- b = c;
- c = tmp;
-
- return 0;
- }
-
work29.c
- #include <stdio.h>
-
- int main(void){
-
- int sute, age, sisha;
- double a, b;
-
-
- sute = (int) (a + b);
- age = (int) (a + b + 0.9);
- sisha = (int) (a + b +0.5);
-
- return 0;
- }
-
work2a.c
- #include <stdio.h>
-
- int main(void){
-
- int d;
- double a, b, c;
-
- b = b * 10;
-
- d = (int) ( a / b + 0.5);
- c = d * b;
-
- return 0;
- }
-