-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1-3.c
More file actions
266 lines (239 loc) · 3.51 KB
/
Copy path1-3.c
File metadata and controls
266 lines (239 loc) · 3.51 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
//int my_strlen(char* str)
//{
// int count = 0;
// while (*str != '\0')
// {
// ++count;
// str++;
// }
// return count;
//}
//
//
//
//int main()
//{
// char arr[] = "abc";
// int len = my_strlen(arr);
//
// printf("%d\n", len);
//
// return 0;
//}
//int main()
//{
// int x = 6, y, z;
// x *= 18 + 1;
// printf("%d\n", x--);
// x += y = z = 11;
// printf("%d\n", x);
// x = y == z;
// printf("%d\n", -x++);
// return 0;
//}
//int main()
//{
// int a = 0, b = 0;
// char c;
// scanf("%d%c%d", &a, &c, &b);
// printf("%d,%c,%d", a, c, b);
// return 0;
//}
//
//int main()
//{
// double d = 3.2;
// int x, y;
// x = 1.2;
// y = (x + 3.8) / 5.0;
// printf("%d\n", d * y);
// return 0;
//}
//int main()
//{
// char c1, c2;
// int a, b;
// c1 = getchar();
// c2 = getchar();
// a = c1 - '0';
// b = a * 10 + (c2 - '0');
// printf("%d", b);
// return 0;
//}
//
//int main()
//{
// char password[100] = { 0 };
// printf("请输入密码:");
// scanf("%s", password);
// int len = 0;
// while (password[len] != '\0')
// {
// len++;
// }
// for (int i = 0; i < len; i++)
// {
// password[i] = password[i] + 5;
//
// }
// printf("加密后的密码是:%s\n", password);
//
//
// return 0;
//}
#include<math.h>
//
//int main()
//{
// int a ;
// int b ;
// int c ;
//
// while (1)
// {
// printf("请输入三个整数:");
// scanf("%d%d%d", &a, &b, &c);
//
// if (b * b - 4 * a * c < 0)
// {
// printf("方程无根,请重新输入:\n");
// continue;
//
// }
// else if (a == 0)
// {
// printf("方程不是一元二次方程,请重新输入:\n");
// continue;
//
// }
// else
// {
// double x1, x2;
// x1 = (-b + sqrt(b * b - 4 * a * c)) / (2.0 * a);
// x2 = (-b - sqrt(b * b -4 * a * c)) / (2.0 * a);
// printf("x1=%.2f,x2=%.2f\n", x1, x2);
// break;
// }
// }
// return 0;
//}
//int main()
//{
// double depoisit = 0.0;
// int n = 0;
// int capital = 0;
// printf("请输入存款金额:");
// scanf("%d", &capital);
// printf("请输入存款年限:");
// scanf("%d", &n);
// double rate = 0;
// printf("请输入存款利率:");
// scanf("%lf", &rate);
// for (int i = 0; i < n; i++)
// {
// rate += 0.005;
// depoisit = capital * (1 + rate);
// }
// printf("存款%d年后的本息是:%.2f\n", n, depoisit);
// return 0;
//
//}
//
//
//
//#define NUMBER 5
//#define FAILED -1
//
//int search(int v[], int key, int n)
//{
// int i = 0;
//
// v[n] = key;
//
// while (1)
// {
// if (v[i] == key)
// break;
// i++;
// }
// return (i < n) ? i : FAILED;
//}
//
//int main()
//{
// int i, ky, idx;
// int vx[NUMBER + 1];
//
// for (i = 0; i < NUMBER; i++)
// {
// printf("vx[%d]:", i);
// scanf("%d", &vx[i]);
// }
// printf("请输入要查找的值:");
// scanf("%d", &ky);
//
// if ((idx = search(vx, ky, NUMBER)) == FAILED)
// puts("\a查找失败.");
// else
// printf("%d是数组的第%d号元素.\n", ky, idx + 1);
//
// return 0;
//
//
//}
//
//#define NUMBER 8
//
//int search_idx(const int v[], int idx[], int key, int n)
//{
// int i=0;
//
// int count = 0;
//
// while (1)
// {
// if (i == n)
// break;
// if (v[i] == key)
// {
// idx[count] = i;
// count++;
//
//
//
// }
//
// i++;
//
//
//
//
// }
// return count;
//}
//
//int main()
//{
// int idx;
// int h;
// int vx[NUMBER] = { 0 };
// int vv[NUMBER];
// int i = 0;
// for (i = 0; i < NUMBER; i++)
// {
// printf("vx[%d]:", i);
// scanf("%d", &vx[i]);
// }
// printf("请输入一个在数组中的数:");
// scanf("%d", &h);
// idx = search_idx(vx, vv, h, NUMBER);
//
// printf("有%d个%d,下标分别为:", idx, h);
// for (i = 0; i < idx; i++)
// printf("%d", vv[i]);
//
// return 0;
//
//}