首页| 论坛| 消息
主题:学c的一起来帮我看看我写的程序错在哪里
pan524发表于 2008-11-11 23:38
描述 Description
基德穿破层层障碍终于来到了"忧郁的生日"面前."忧郁的生日"如前题所述封存于密码锁中.这个密码锁不是一般的密码锁,这是不一
般的密码锁!这个密码锁上显示着一串数字.旁边还有一串提示:The password is in the number.The number is on screen,you s-
hould delete N numbers as 1,2 or 3...9.The last number should be the smallest of all.The last number is the passwo-
rd(基德:靠,提示居然是E文,无视我400的智商吗?!).为了成功盗取并尽快赶去青子家,基德请你编一个程序解决这个密码锁。

输入格式 Input Format
输入共2行
第一行为一个不超过250位的数字;
第二行则为N。

输出格式 Output Format
输出只有一行,即PASSWORD.
样例输入 Sample Input
178543
4

样例输出 Sample Output

13

我写的程序是:
#include
#include
int fac(int a,int b)
{int hanshu;
if(a>b)
hanshu=a;
else
hanshu=b;
return hanshu;
}

int main()
{
int a[250],i,len,n,b[250]={0};
char s[250];
scanf("%s",s);
len=strlen(s);
scanf("%d",&n);
for(i=0;i
回帖(0):

--> 全部回帖(0)»
最新回帖
收藏本帖
发新帖