像有的源程序的每一句后都加了注释,那是如何加上去的,是自己在记事本里加的,还是有软件啊。
来源:百度知道 编辑:UC知道 时间:2024/06/27 06:40:25
例如:
#include <stdio.h>
void fun(char s1[],char s2[])
{
int i,j=0;
for(i=0;s1[i] != '\0'; i++)
{
if (s1[i]>='0' && s1[i]<='9')
{
s2[j]=s1[i];
j++;
continue;
}
if (j==0)
{
s2[j]= ' ';
j++;
}
else if (s2[j-1] != ' ')
{
s2[j] = ' ';
j++;
}
}
s2[j] = '\0';
}
void main ( )
{
char str1[81];
char str2[81];
printf ("Input a string: ");
gets (str1);
fun (str1,str2);
printf ("str2: ");
puts (str2);
printf ("str1: ");
puts (str1);
}
#include <stdio.h>
void fun(char s1[],char s2[])
{
int i,j=0;
for(i=0;s1[i] != '\0'; i++)
{
if (s1[i]>='0' && s1[i]<='9')
{
s2[j]=s1[i];
j++;
continue;
}
if (j==0)
{
s2[j]= ' ';
j++;
}
else if (s2[j-1] != ' ')
{
s2[j] = ' ';
j++;
}
}
s2[j] = '\0';
}
void main ( )
{
char str1[81];
char str2[81];
printf ("Input a string: ");
gets (str1);
fun (str1,str2);
printf ("str2: ");
puts (str2);
printf ("str1: ");
puts (str1);
}
加注释一般的形式就是在你所要注释的行末加上//,然后输入你所要注释的内容,拿你这个程序中的一部分做例子:
void main ( )
{
char str1[81]; //定义字符串str1
char str2[81]; //定义字符串str2
printf ("Input a string: "); //提示输入一个字符串
gets (str1);
fun (str1,str2); //调用函数
printf ("str2: ");
puts (str2);
printf ("str1: ");
puts (str1);
就是类似这样的形式
当然是自己写上去的。
我怎么没看见注释,
我想要一套魔神步的步,是每一步都有的那种像:742141189在8K的加点滑步更好了,先谢谢大家了^_^!
PowerBuilder 源程序有的下载不可以使用的问题?
c++中有的源程序不在fileview面板的列表中
求这首歌的歌名“每一秒像过了一辈 一去不回的飞阿飞”
我的源程序哪里错了?
有的像羊群,来来去去;有的像一张大棉絮,满满地盖住了天空;还有的像峰峦,像河流,像雄师,像奔马……
每一首歌都好像代表了一个人,想对你忘不了的那个人说些话的请进
极品飞车每一代的名称?像地下狂飙,最高通缉什么的。
石头,有的像—,—;有的像—,—;有的像—,—;有的像—,—;还有的像—,像—,像—,像—。
天上的云,有的像( ) 有的像( )