C语言程序设计教程(第三版)课后习题8.3 (C语言代码)(标记法) 摘要:解题思路:用标记法来判断素数,通过返回函数值到主函数来输出结果注意事项:注意循环的使用,和函数值返回参考代码:#include<stdio.h> int f(int a); int main() …… 题解列表 2017年11月26日 2 点赞 0 评论 1554 浏览 评分:0.0
优质题解 Manchester-字符串的输入输出处理 解题思路:1.有n+个待输入字符串;前面n个有空格,后面的字符串没有空格(即后面:DOTCPP是四个字符串);2.因为前面n个字符串原样输出,先用for循环输入(用gets())前n个字符串,每输入一串,输出一串用puts()(自带换行)注意但只是换到下一行让你输入, 题解列表 2017年11月26日 76 点赞 79 评论 16184 浏览 评分:8.9
校门外的树 (C语言代码) 摘要:解题思路:我们只需要用数组模拟一下即可。参考代码:#include <stdio.h> #include <string.h> int main() { int l, m; …… 题解列表 2017年11月25日 1 点赞 0 评论 1864 浏览 评分:0.0
Manchester- A+B for Input-Output Practice (VII) 摘要:解题思路:在1085 题的基础上,再输出一个换行符;下面(1085)#include<stdio.h> int main() { int a,b; while(scanf("%d%d"…… 题解列表 2017年11月25日 16 点赞 0 评论 1675 浏览 评分:8.0
Manchester-A+B for Input-Output Practice 摘要:解题思路:类似1089题,多输出一个换行符;下面(1089)#include<stdio.h> int main() { int n,n1,a,sum=0; scanf("%d",&n);…… 题解列表 2017年11月25日 18 点赞 2 评论 3301 浏览 评分:9.9
优质题解 字符串的修改 (C++代码) 解体思路:贪心对字符串A的增删改都会导致操作次数+1,所以只需找出字符串B中能够对应到字符串A中的字符数目(即不需改动的字符),用A.Length()-count即可求得。注意事项:注意到有可能字符串B的第一个字符对应到字符串A偏后的字符,所以需要循环B.Length()次, 题解列表 2017年11月25日 5 点赞 9 评论 5070 浏览 评分:7.0
IP判断 (C语言代码) 摘要:解题思路:注意事项:参考代码:int Jude(char *s){ int x=0; for(;*s;s++) { if(*s=='.') x=0; else if(*s>=&…… 题解列表 2017年11月25日 0 点赞 0 评论 1313 浏览 评分:0.0
IP判断 (C语言代码) 摘要:解题思路:注意事项:参考代码:int Jude(char *s){ int x=0; for(;*s;s++) { if(*s=='.') x=0; else if(*s>=&…… 题解列表 2017年11月25日 0 点赞 0 评论 1572 浏览 评分:0.0
printf基础练习2 (C语言代码) 摘要:#include<stdio.h>int main(){int a; printf("\n请输入一个整数,不超过10^9:"); scanf("%d",&a); printf("转换…… 题解列表 2017年11月25日 0 点赞 0 评论 1457 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)(一般方法:辗转相除法) 摘要:解题思路:注意辗转相除时的变量的转换就可注意事项:参考代码:#include<stdio.h> int gcd(int a,int b); int lcm(int a,int b); int m…… 题解列表 2017年11月25日 2 点赞 0 评论 1936 浏览 评分:0.0