写了一些没用的代码 权当练习

#include <stdio.h>
double min(double, double);
int main(void)
{
double x, y;

printf("Please enter two numbers (q to quit):");
while (scanf("%lf %lf", &x, &y) == 2){
    printf("The smaller number is %f.\n", min(x, y));
    printf("Next two value");
}

}
double min(double n, double m){

double mi;

mi = (n > m) ? m : n;

return mi;

}

#include <stdio.h>
void cline (char, int, int);
int main()
{
printf(“Please enter a word: \n”);
cline(char, int, int);
}
cline (char w, int l, int hang)
{
int nl, nhang;
while(scanf("%c %d %d", &w, &l, &hang) == 2){
for (nl = 0; nl < l; nl++)
for (nhang = 0; nhang < hang; hang++)
;
}
}

#include <stdio.h>
double tiaohe(double, double);
int main(void)
{
double e, d;
//佛祖保佑佛祖保佑佛祖保佑
printf(“Please plesa please q to qiut\n”);
printf("%f", tiaohe(e, d));
}
double tiaohe (double x, double c)
{
double i = 0.0;

while((scanf("%lf %lf", &x, &c)) == 2)
    i = 1/((1/x + 1/c)/2);
return i;

}

#include <stdio.h>
double ret(double, double);
int main(void)
{
double a, b;
printf(“Enter two number:\n”);
printf(“The max would be %lf”, ret (a, b));
}
double ret(double z, double s)
{
double rev;
while ((scanf("%lf %lf", &z, &s)) == 2){
rev = (z > s ? z : s);
break;
}
return rev;
}

#include <stdio.h>
double min(double, int);
int main(void)
{
double a;
int a_1;
int x = ‘-1’;
printf(“This is an request order, enter two numbers plz: “);
while ((scanf(”%d %lf”, &a_1, &a)) == 2)
{
if (a < 0){
if (a_1 % 2 == 0)
printf(“It’s %lf”, min(a, a_1));
else
printf(“It’s %lf”, min(a, a_1)) * x)
}
else
printf(“It’s %lf”, min(a, a_1));
}
}
double min(double z, int c)
{
double rev = 1;
for (int k = 1; k < c; k++)
rev *= z;
return rev;
}

#include <stdio.h>
unsigned Fibonacci(unsigned n);
int main(void)
{
unsigned a;
printf(“There gonna be a Fibonacci number”);
while (scanf("%d", &a) == 1){
printf(“It’s %u”, Fibonacci(a));
continue;
}
return 0;
}
unsigned Fibonacci(unsigned s)
{
if (s > 2)
return Fibonacci(s - 1) + Fibonacci(s - 2);
else
return 1;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值