c语言编程输出1?
c语言编程输出1——100之间所有的奇数和偶数,并按每行8个打印输出 求解
#include "stdio.h" int main() { int countou,countji=0; int i=0; for(i=1;i<=100;i++) { if(i%2==0) countou+=i; else countji+=i; } printf("偶数和:%d\n 奇数和:%d",countou,countji); return 0; }
问:挺简单的一C函数,不过我是初学者,暂时还不会写,请好心人多多帮忙!
答:int mystrlen(char *str) { int n = 0; while (*str) { n++; str++;} return n; } voi...详情>>