2019-10-09 23:42:18
#include <stdio.h>void _strcat(char str1[],char str2[]){ int i,j; for(i=0;str1[i]!='\0';i++); for(j=0;str2[j]!='\0';j++) str1[i+j]=str2[j];  
2019-09-25 21:41:52
#include <stdio.h>int fun(int lim,int aa[]){ int i,j=0,k=0; for(i=2;i<lim;i++){ for(j=2;j<i;j++) if(i%j==0) break; if(j==i) aa[k++]=i; } return k; } int main(){ int aa[100],i; fun(100,
2019-09-15 15:59:06
#include <stdio.h>void Scrip(char* lead);int main(){ char cSelect[]=""; printf("导演选定的主角是:"); scanf("%s",&cSelect); Scrip(cSelect); return 0;}void Scrip(char* lead){ printf("%s开始参演这个剧本\n",lead);}
2019-09-15 15:53:51
#include<stdio.h>int getTemperature();int main(){ getTemperature(); return 0;}int getTemperature(){ int temperature; printf("please input a temperature:\n"); scanf("%d",&temperature); printf("当前的温度是:%d\n",tempe
2019-09-15 15:22:33
#include <stdio.h>void Poem();int main(){ Poem(); return 0;}void Poem(){ printf("两个黄鹂鸣翠柳\n"); printf("一行白鹭上青天\n"); printf("窗含西岭千秋雪\n"); printf("门泊东吴万里船\n");}
2019-09-13 20:40:51
#include <stdio.h>void Cook();void Fish();void Poem();int main(){ Cook(); Fish(); Poem(); return 0;}void Cook(){ printf("会做饭\n");}void Fish(){ printf("会钓鱼\n");}void Poem(){ printf("会写诗\n");}
2019-08-14 23:51:13
#include <stdio.h>int main(){ int i; char String[5]={"live"}; char Reverse[5]={0}; int size=sizeof(String); for(i=0;i<4;i++){ Reverse[size-i-2]=String[i]; } printf("输出源字符串:%s\n",String); printf("反过来的输出字符串:%s\n
2019-08-14 23:23:48
#include <stdio.h>#include <string.h>int main(){ char text[50]; printf("请输入一个密码:\n"); scanf("%s",&text); if(strlen(text)==6) printf("输入的密码是6位\n"); else printf("输入的密码不是6位\n"); return 0;}
2019-08-14 22:39:57
#include <stdio.h>#include <string.h>int main(){ char change[20],text[20]; printf("输入一个字符串:\n"); scanf("%s",&text); strcpy(change,text); strupr(change); printf("转换成大写字母的字符串是:%s\n",change); return 0;}
2019-08-14 22:25:51
#include <stdio.h>#include <string.h>int main(){ char user[20]={"exit"}; char ustr[20]; while(strcmp(user,ustr)!=0){ printf("请输入字符串:\n"); gets(ustr); puts(ustr); } return 0;}