现在的位置: 首页 > 综合 > 正文

hdu4018

2018年02月22日 ⁄ 综合 ⁄ 共 611字 ⁄ 字号 评论关闭

#include<stdio.h>
#include<string.h>
char a[10000];
int main()
{
    int t,i=0;

    while(scanf("%d",&t)==1)
    {
        while(t--)
        {
            getchar();
            scanf("%s",a);
            i++;
            printf("Case #%d: ",i);
            int j,flog=0;
            for(j=0;j<strlen(a);j++)
            {
                if(a[j]==':'&&a[j+1]=='/'&&a[j+2]=='/')
                {
                    flog=1;
                    j+=2;
                }
                else if(flog&&(a[j]!='/'&&a[j]!=':')) printf("%c",a[j]);
                else if((a[j]=='/'||a[j]==':')&&flog) break;
            }
            printf("\n");
        }
    }
    return 0;
}

抱歉!评论已关闭.