直。
#include<stdio.h>
#include<string.h>
#define N 255
void fun(char [],char []);
int main()
{
char a[N],b[N];
gets(a);
fun(a,b);
puts(b);
return 0;
}
void fun(char a[],char b[])
{
int i=0,j;
for(j=0;a[j]!='\0';j++);
j--;
for(;j>=0;j--)
b[i++]=a[j];
b[i]='\0';
}
#include<stdio.h>
#define N 20
int fun(int k);
int main(void)
{
char a[N];
int i,j,n,x,k=1,sum=1;
scanf("%d\n",&n);
gets(a);
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]==a[j])
k++;}
x=fun(k);
k=1;
sum*=x;
}
printf("%d",fun(n)/sum);
return 0;
}
int fun(int k)
{int x=1,i;
for(i=1;i<=k;i++)
x*=i;
return x;}```
3.
![Paste_Image.png](http://upload-images.jianshu.io/upload_images/1694063-cccbf05ad905ccd8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
```cpp
#include<stdio.h>
#include<string.h>
#define N 255
void fun(char [],char []);
int change(char [],char []);
int main()
{
char a[N],b[N];
gets(a);
fun(a,b);
if(change(a,b)==0)
printf("Y");
else
printf("N");
return 0;
}
void fun(char a[],char b[])
{
int i=0,j;
for(j=0;a[j]!='\0';j++);
j--;
for(;j>=0;j--)
b[i++]=a[j];
b[i]='\0';
}
int change(char a[],char b[])
{
int i=0;
for(i=0;a[i]==b[i];i++)
if(a[i]=='\0')
return 0;
return 1;
}```
4.
![Paste_Image.png](http://upload-images.jianshu.io/upload_images/1694063-81398b6f35ae4b76.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
```cpp
#include<stdio.h>
#include<string.h>
#define N 100
void fun(char [],char []);
int main()
{
char a[N],b[N];
gets(a);
fun(a,b);
puts(b);
}
void fun(char a[],char b[])
{
int i=0,j;
for(j=0;a[j]!='\0';j++);
j--;
for(;j>=0;j--)
b[i++]=a[j];
b[i]='\0';
}
#include<stdio.h>
#include<string.h>
#define N 100
void fun(char [],char []);
int main()
{
char a[N],b[N];
gets(a);
gets(b);
fun(a,b);
puts(a);
return 0;
}
void fun(char a[],char b[])
{
int i,j;
for(j=0;a[j]!='\0';j++);
for(i=0;b[i]!='\0';i++)
{
a[j]=b[i];
j++;
}
a[j]='\0';
}```
6.
![Paste_Image.png](http://upload-images.jianshu.io/upload_images/1694063-34fc596fe432ef47.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
```cpp
#include<stdio.h>
#include<string.h>
#include<math.h>
#define N 100
int fun(char []);
int main()
{
char a[N];
gets(a);
printf("%d",fun(a));
return 0;
}
int fun(char a[])
{
int i,j,sum=0;
for(j=0;a[j]!='\0';j++);
for(i=0;a[i]!='\0';i++)
{
sum+=(a[i]-48)*pow(8,--j);
}
return sum;
}```
7.
![Paste_Image.png](http://upload-images.jianshu.io/upload_images/1694063-6f2509d812abd1b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
```cpp
#include<stdio.h>
void fun(char *p)
{
int i,j=0;
char a[1024];
for(i=0;p[i]!='\0';i++)
if(p[i]!='*')
a[j++]=p[i];
a[j]='\0';
for(i=0;a[i]!='\0';i++)
p[i]=a[i];
p[i]='\0';
}
int main()
{
char b[1024];
while(gets(b)!=NULL)
{
fun(b);
printf("%s\n",b);
}
return 1;
}```
8.
![Paste_Image.png](http://upload-images.jianshu.io/upload_images/1694063-e8980d278aa9986d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
```cpp
#include<stdio.h>
void fun(char [],char []);
#define N 256
int main()
{
char a[N],b[N];
int n=0,k=0,i;
gets(a);
gets(b);
for(i=0;a[i]!='\0';i++)
n++;
for(i=0;b[i]!='\0';i++)
k++;
if(n==k)
printf("error");
else if(n>k)
{
for(i=0;i<k;i++)
a[i]=b[i];
puts(a);
}
else if(n<k)
{
for(i=0;i<n;i++)
b[i]=a[i];
puts(b);
}
return 0;
}```