程设写迷惑代码第一天

  1. 1. Descrption
  2. 2. 毒瘤代码一
  3. 3. Description
  4. 4. 毒瘤代码二
  5. 5. Description
  6. 6. 毒瘤代码三
  7. 7. Description
  8. 8. 毒瘤代码四

突然找到了写毒瘤代码的快感XDDDD:

Descrption

输出 hello, world

别忘了换行哦 _

毒瘤代码一

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include<stdio.h>
int main(){
char s[13];
for(int i=0;i<13;i++){
if(i==0){
int j=0;
while(j<104){
j++;
}
s[i]=j;
}
if(i==1){
int j=0;
while(j<101){
j++;
}
s[i]=j;
}
if(i==2){
int j=0;
while(j<108){
j++;
}
s[i]=j;
}
if(i==3){
int j=0;
while(j<108){
j++;
}
s[i]=j;
}
if(i==4){
int j=0;
while(j<111){
j++;
}
s[i]=j;
}
if(i==5){
int j=0;
while(j<44){
j++;
}
s[i]=j;
}
if(i==6){
int j=0;
while(j<32){
j++;
}
s[i]=j;
}
if(i==7){
int j=0;
while(j<119){
j++;
}
s[i]=j;
}
if(i==8){
int j=0;
while(j<111){
j++;
}
s[i]=j;
}
if(i==9){
int j=0;
while(j<114){
j++;
}
s[i]=j;
}
if(i==10){
int j=0;
while(j<108){
j++;
}
s[i]=j;
}
if(i==11){
int j=0;
while(j<100){
j++;
}
s[i]=j;
}
if(i==12){
int j=0;
while(j<'\n'){
j++;
}
s[i]=j;
}
if(i==13){
int j=0;
while(j<0){
j++;
}
s[i]=j;
}
}
printf("%s",s);
return 0;
}

然而并没有逃过matrix的法眼

Description

计算两个整数a,b的和,整数范围为-1000<a,b<1000。

毒瘤代码二

1
2
3
4
5
6
7
8
9
#include<stdio.h>

int main(){
int a,b;
scanf("%d",&a);
scanf("%d",&b);
printf("%d\n",a^a^a^a^a^a^a^a^a-a-a-a-a+a+a+a+a+b^b^b^b^b-b-b-b-b+b+b+b+b);
return 0;
}

Description

In one week an employee works h hours (h is an integer and 0<h<168) at the hourly pay rate of 24.75 dollar. Assume a 40.0 hour normal work week and an overtime pay rate factor of 1.5.

What are the employee’s wages?

毒瘤代码三

1
2
3
4
5
6
#include <stdio.h>
int main(){
int hours=0;
scanf("%d",&hours);
printf("%.2f\n", 24.75 * hours + (hours > 40 ? 0.5f*24.75*(hours-40):0.0));
}

Description

Write a program that reads in the radius and length of a cylinder and computes volume using the following formulas: area = radius * radius * PI volume = area * length PI = 3.14159

毒瘤代码四

1
2
3
4
5
6
7
8
#include <stdio.h>
int main(){
double pi = 2,now=2.0/3,r,l;
scanf("%lf%lf",&r,&l);
for (int i = 1; i < 30;pi = pi + now,now = now * (i + 1) / ((2 * (i + 1)) + 1),i++);
printf("%.4lf",pi*r*r*l);
return 0;
}

照这样写代码被打死可不要怪我。