Sign-up....

帮我修改个程序好吗?

#include "stdio.h"

int floor(float);

main()

{

float b;

printf("enter a number:");

scanf("%f",&b);

printf("the match number:%d.\n",floor(b));

}

int floor(float x,int y)

{

y=floor(x+.5);

return y;

}

[224 byte] By [12] at [2007-11-17 11:05:57]
# 1 Re: 帮我修改个程序好吗?
#include <stdio.h>

int main()

{

float b;

printf("enter a number:");

scanf("%f",&b);

printf("the original number:%f\n",b);

printf("the match number:%d\n",int(b+0.5));

return 0;

}

kghost at 2007-2-13 8:46:15 >
# 2 Re: 帮我修改个程序好吗?
#include<iostream>

using namespace std;

int main()

{

float f;

cout<<"Please input a number:";

cin>>f;

cout<<"The number is:"<<f<<endl;

cout<<"The match number is:"<<int(f+0.5)<<endl;

return 0;

}

笨小孩 at 2007-2-13 8:46:22 >
# 3 Re: 帮我修改个程序好吗?
#include <stdio.h>

int main()

{

float b;

printf("Please input a number:");

scanf("%f",&b);

printf("the enter number is:%f\n", b);

printf("the match number is:%d\n",int(b+0.5));

return 0;

}

人一定要靠自己 at 2007-2-13 8:46:27 >
# 4 Re: 帮我修改个程序好吗?
#include <stdio.h>

int floor(float);

void main(void)

{

float b;

printf("enter a number:");

scanf("%f",&b);

printf("the match number:%d.\n",floor(b));

}

int floor(float x)

{

int y;

y=int(x + 0.5);

return y;

}

要遵守作者的原作嘛,呵呵

红尘一客 at 2007-2-13 8:46:40 >

C/C++

All Classified