![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习ing
matcha.title ( )
这个作者很懒,什么都没留下…
展开
-
判断奇偶数量(划水版)
#include<stdio.h>int main(){ int k,d=0,s=0; scanf("%d",&k); while(k != -1) { if(k % 2 >0) { d++; }else if(k % 2 == 0) { s++; } scanf("%d",&k); }...原创 2021-10-16 09:12:10 · 96 阅读 · 0 评论 -
简单的正序输出
#include<stdio.h>int main(){ int a; int mask = 1; int x; int t; scanf("%d",&a); x = a; while (x >9) { x /= 10; mask *= 10; } do { t = a/mask; pr...原创 2021-10-16 09:11:02 · 64 阅读 · 0 评论 -
简单的二分搜索
#include<stdio.h>int amount[] = {1,2,3,4,5,6,7,8,9};int search(int key,int amount[],int len){ int right,left,mid; int ret = -1; left = amount[0]; right = amount[8]; mid = (left+right)/2; while(left<right) { ...原创 2021-10-16 09:09:46 · 50 阅读 · 0 评论 -
结构体搜索
#include<stdio.h>int a[] = {15,25,35,45,55};char *names[] ={"we","that","her","him","me"};struct{ int a; char *names;}coins[]={ {15,"we"}, {25,"that"}, {35,"her"}, {45,"him"}, {55,"me"}}...原创 2021-10-16 09:08:10 · 75 阅读 · 0 评论 -
简单的搜索
#include<stdio.h>int number[] = {12,5,6,4,55,69,58};char *name[] = {"nn","pe","se","fe","at","wr","sff"};int search(int key,int a[],int len){ int ret = -1; for (int i = 0;i<len;i ++) { ret = -1; if (key ==...原创 2021-10-16 08:17:27 · 46 阅读 · 0 评论