mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
commit
7139acb711
34
QUSTOJ/1235.cpp
Normal file
34
QUSTOJ/1235.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
using namespace std;
|
||||
int data[1005];
|
||||
char cmdline[10240];
|
||||
char buff[32];
|
||||
int main()
|
||||
{
|
||||
int inc,times,count;
|
||||
while(scanf("%d",×)==1)
|
||||
{
|
||||
memset(data,0,sizeof(int)*1005);
|
||||
memset(cmdline,0,10240);
|
||||
count=0;
|
||||
for(int i=0;i<times;i++)
|
||||
{
|
||||
scanf("%d",&inc);
|
||||
data[inc]++;
|
||||
}
|
||||
for(int i=0;i<1005;i++)
|
||||
{
|
||||
if(data[i])
|
||||
{
|
||||
count++;
|
||||
sprintf(buff,"%d ",i);
|
||||
strcat(cmdline,buff);
|
||||
}
|
||||
}
|
||||
cmdline[strlen(cmdline)-1]='\0';
|
||||
printf("%d\n%s\n",count,cmdline);
|
||||
}
|
||||
return 0;
|
||||
}
|
43
QUSTOJ/1312.cpp
Normal file
43
QUSTOJ/1312.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
using namespace std;
|
||||
char buff[1024];
|
||||
int main()
|
||||
{
|
||||
int times;
|
||||
scanf("%d%*c",×);
|
||||
for(;times>0;times--)
|
||||
{
|
||||
memset(buff,0,1024);
|
||||
gets(buff);
|
||||
int len=strlen(buff);
|
||||
for(int i=0;i<len;i++)
|
||||
{
|
||||
if(buff[i]=='\\')
|
||||
{
|
||||
buff[i]='/';
|
||||
}
|
||||
}
|
||||
if(buff[0]=='/')
|
||||
{
|
||||
printf("It's a path in Unix-like systems!\n%s\n",buff);
|
||||
continue;
|
||||
}
|
||||
if(strstr(buff,"://")!=NULL)
|
||||
{
|
||||
printf("It's a URL!\n%s\n",buff);
|
||||
continue;
|
||||
}
|
||||
printf("It's a path in Windows system!\n");
|
||||
for(int i=0;i<len;i++)
|
||||
{
|
||||
if(buff[i]=='/')
|
||||
{
|
||||
buff[i]='\\';
|
||||
}
|
||||
}
|
||||
puts(buff);
|
||||
}
|
||||
return 0;
|
||||
}
|
6
QUSTOJ/1326.c
Normal file
6
QUSTOJ/1326.c
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include <stdio.h>
|
||||
int main()
|
||||
{
|
||||
printf("**************************\n Very Good!\n**************************\n");
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user