|
楼主 |
发表于 2004-11-22 09:56:02
|
显示全部楼层
#include <stdio.h>
#include <stdlib.h> /* for EXIT_SUCCESS */
int main(void)
{
print(“Hello World!”);
return EXIT_SUCCESS;
}
********
#include <stdio.h>
int main(void)
{
printf(“Hello World!\n”);
}
********
#include <stdio.h>
int main(void)
{
int ending =100005130;
int five =5;
printf(“five=%d;ending=%d\n”,five,ending);
return 0;
}
*********
#include <stdio.h>
int main(void)
{
int counter;
int ending;
int temp;
int five;
for(counter=0;counter<2*100000000*9/18+5131;
cunnter+=(5-3)/2)
{
temp=counter/15302;
ending=counter;
five=5;
}
printf(“five=%d;ending=%d\n”,five,ending);
return 0;
}
********
#include <stdio.h>
int main(void)
{
int input =0;
printf(“Enter an integer:”);
scanf(“%d”,input);
printf(“Twice the number you supplied is %d.\n”,2*input);
return 0;
}
***********
#include <stdio.h>
void my_print()
void my_print2()
main( )
{
char my_string[]= “Hello World!”;
my_print(my_string);
my_print2(my_string);
}
void my_print(char *string)
{
printf(“The string is %s\n”,string);
}
void my_print2(char *string)
{
char *string2;
int size,size2,j;
size=strlen(string);
size2=size-1;
string2=(char *)malloc(size+1);
for(j=0;j<size;j++)
string2[size2-j]=string[j];
string2[size]= ‘\0’;
printf(“The string printed backward is %s\n”,string2);
} |
|