http://acm.hust.edu.cn/vjudge/contest/view.action?cid=26399#overview

果断开小号水过

CodeForces 58A

#include<string.h>
#include<iostream>
#include<stdio.h>
using namespace std;
char a[]="hello";
char s[1000];
int main()
{
    while(cin>>s)
    {
        int k=0;
        for(int i=0;i<strlen(s);i++)
        {
            if(s[i]==a[k])
            k++;
        }
        if(k==5)
        printf("YES\n");
        else
        printf("NO\n");
    }
    return 0;
}

CodeForces 58B

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        if(n==1)
        {
            printf("1\n");
            continue;
        }
        int k=n;
        printf("%d ",n);
        while(n--)
        {
            if(n==1)
            break;
            if(k%n==0)
            {printf("%d ",n);k=n;}
        }
        printf("1\n");
    }
    return 0;
}
View Code

相关文章: