急..请教C语言高手帮我解决几道题.

来源:百度知道 编辑:UC知道 时间:2024/05/14 15:11:08
1 写一个函数,将第2个字符串连接在第一个字符串尾部,不使用标准函数.

2 从键盘输入一个整数,将其转化为字符串后输出.

3 输出所有含7或者能被7整除的所有3位数.

4 求一个字符串中,字母C出现的次数.

5 从键盘上输入一个字符串,将大写转化为小写,小写转化为大写后输出.

6 S=1+(1+2)+(1+2+3)+...+(1+2+3+...+10).

***No1***
char str1[100];
char str2[100];

void Strcat(str1,str2)
char str1[],str2[];
{
int len;
int i=0;
len=strlen(str1);
while(str2[i])
{
str1[i+len]=str2[i];
i++;
}
}

int main()
{
scanf("%s",&str1);
scanf("%s",&str2);
Strcat(str1,str2);
printf("%s",str1);
getchar();
getchar();

}

***No2***
long d;
char l[20];

int n2l()
{
int i;
int b=0;
long temp;
temp=d;
l[0]='-';
while(d!=0)
{
d=d/10;
b++;
}
d=temp;
if(temp<0)temp=-temp;
while(temp!=0)
{
i=temp%10;
temp=temp/10;
if(d<0) l[b]=i+'0';
else l[b-1]=i+&#