| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1711 人关注过本帖
标题:现在正在考试中,大家帮帮小弟的忙吧!
只看楼主 加入收藏
海底的龙
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-5-13
收藏
得分:0 
回复 1# lukechen1990 的帖子
#inlude<stdio.h>
main()
{
int plusresult , q , i = j = 1;
plusresult = 0;
scanf("%d",&q);
while(plusresult+1<=q)
{
plusresult = plusresult + ( i + 1 )/i ;
++i;
}
printf("%d",plusresult)
}
2008-06-11 08:37
海底的龙
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-5-13
收藏
得分:0 
回复 1# lukechen1990 的帖子
#include<stdio.h>
void exchange( int x ,int y)
{
int t ;
t = x ;
x = y ;
y = t ;
}
int max(int x , int y )
{
int t ;
t = x>y?x:y ;
return t ;
}
main()
{
int a[10] , b[2];
for(int i = 0 ; i<10 ; i++ )
{
scanf("%d",a[i]);
}
int t = a[0] ;
for(i = 0;i<10 ;i++)
{
if(t==a[i])
continue ;
else
t = max( t ,a[i] );
}
for(i=0; i<10 ; i++)
if(t == a[i])
break;
exchange( a[0],a[i]);
b[0] = a[0] ;
a[0]=a[1];
t = a[0] ;
for(i = 0;i<10 ;i++)
{
if(t==a[i])
continue ;
else
t = max( t ,a[i] );
}
for(i=0; i<10 ; i++)
if(t == a[i])
break;

exchange( a[1],a[i]);
a[0] = b[0] ;
for(i=0;i<10;i++)
printf("%d",&a[i]);
}
2008-06-11 09:42
快速回复:现在正在考试中,大家帮帮小弟的忙吧!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024063 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved