第1个回答 2019-11-20

#include<stdio.h>
void main() { int n; double h;
h=0.00006; n=0; while ( h<386000000 ) { n++; h*=2; }
printf("%d\n",n);
}

第2个回答 2007-06-27
#include<stdio.h>
#define N 200
struct child
{
char name[10];
char sex[3];
int age;
int height;
float weight;
struct {
int year;
int month;
int day;
}bdate;
}ch[N];
void input()
{
int i;
for(i=0;i<N;i++)
{
printf("\n请输入第%d名小朋友信息:\n",i+1);
printf("姓名:");
scanf("%s",ch[i].name);
printf("性别:");
scanf("%s",ch[i].sex);
printf("年龄:");
scanf("%d",&ch[i].age);
printf("身高:");
scanf("%d",&ch[i].height);
printf("体重:");
scanf("%f",&ch[i].weight);
printf("出生日期[YYYY-MM-DD]:");
scanf("%d-%d-%d",&ch[i].bdate.year,&ch[i].bdate.month,&ch[i].bdate.day);
}
}
void sort()
{
struct child ct;
int i,j;
for(i=0;i<N-1;i++)
for(j=0;j<N-i-1;j++)
if(ch[j].height<ch[j+1].height)
{
ct=ch[j];
ch[j]=ch[j+1];
ch[j+1]=ct;
}
}
void output()
{
int i;
printf("\n\t幼儿园小朋友一览(依身高排序)\n");
printf("===================================================\n");
printf(" 姓名 性别 年龄 身高 体重 出生日期 \n");
printf("===================================================\n");
for(i=0;i<N;i++)
printf(" %-8s %-2s %2d %d %3.1f %d.%d.%d\n",ch[i].name,ch[i].sex,ch[i].age,ch[i].height,ch[i].weight,ch[i].bdate.year,ch[i].bdate.month,ch[i].bdate.day);
}
void main()
{
input();
sort();
output();
}
//分给的忒少,呵呵
第3个回答 2019-11-20
是真的,见如下求解
2↑43×0.006=5.277655813×10↑10厘米
=5.277655813×10↑8米
=5.277655813×10↑5千米
=527,765.5813千米大于386,000千米
第4个回答 2011-10-25
#include <stdio.h>
#include <stdlib.h>
int isLeepYear(int year)
{
return (year%4==0&&year%100!=0||year%400==0);
}
int getDaysOfMonth(int year,int month)
{
int nDays[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},nDay;
if(year<0||month<1||month>12) return 0;
nDay=nDays[month];
if(isLeepYear(year)&&month==2) nDay++;
return nDay;
}
int main()
{
int year,month;
printf("请输入年份和月份:\n");
scanf("%d %d",&year,&month);
printf("%d年%d月有%d天\n",year,month,getDaysOfMonth(year,month));
system("pause");
return 0;
}
第5个回答 2012-11-07
Guys, hope you can solve such issue by yourself in the future. This is easy. There are maybe some issue in the program, I don't compile it.
#include <stdio.h>
#define VALIAD 4
int IsBoxCanParcelBall(double long, double wide, doube high, double radius);
int main(int argc, char* argv[])
{
double dlong, dwide, dhigh, dradius;
printf("This program is to test whether a box can parcel a ball, just for fun.\n");
printf("Please input long, wide, high of box, and radius of ball,
if you want to quit, please input ‘q’ and Enter keyboard\n");
while(1) {
if(VALIAD != scanf("%f%f%f%f", &dlong, &dwide, &dhigh, &dradius){
break;
}
printf("Result:");
if(IsBoxCanParcelBall(dlong, dwide, dhigh, dradius)) {
printf("Yes[Y]\n");
} else {
printf("No[N]\n");
}
printf("Please input long, wide, high of box, and radius of ball,
if you want to quit, please input ‘q’ and Enter keyboard\n");\n");
}
return 0;
}
int IsBoxCanParcelBall(double long, double wide, doube high, double radius)
{
if ((long > 2*radius) && (wide > 2*radius) && (high > 2*radius)) {
return 1;
} else {
return 0;
}
}