首页 > 其他分享 >每日打卡·

每日打卡·

时间:2023-04-20 21:13:50浏览次数:37  
标签:return int MAXS 每日 char ++ 打卡 include

//#include<iostream>
//#include <stdio.h>
//#include<string>
//using namespace std;
//char* search(char* s, char* t);
//int main()
//{
// char s[30] = "";
// char c;
// c = getchar(); int i = 0;
// while (c != '\n')
// {
// s[i] = c;
// i++;
// c = getchar();
// }
// char a;char t[30] = "";
// a = getchar(); int j = 0;
// while (a != '\n')
// {
// t[j] = a;
// j++;
// a = getchar();
// }
//
// char *pos = search(s, t);
// if (pos != NULL)
// printf("%d\n", pos - s);
// else
// printf("-1\n");
//
// return 0;
//}
//char* search(char* s, char* t)
//{
// char a;
// int j = strlen(t); char* p = NULL;
// for (int i = 0; i < strlen(s); i++)
// {
// if (s[i] == t[0])
// {
// if (j == 1)
// {
// p = &s[i];
// break;
// }
// int count = 1;
// for (int n = 1; n < j; n++)
// {
// int m = i;
// i++;
// if (s[i] == t[n])
// {
// count++;
// }
// if (count == j)
// {
// p = &s[m-1];
// break;
// }
// }
// }
// }
//
// return p;
//}

//#include <stdio.h>
//#include<string>
//#define MAXS 10
//#include<iostream>
//using namespace std;
//char* match(char* s, char ch1, char ch2);
//int main()
//{
// char str[MAXS], ch_start, ch_end, * p;
//
// scanf_s("%s\n", str);
// scanf_s("%c %c", &ch_start, &ch_end);
// p = match(str, ch_start, ch_end);
// printf("%s\n", p);
//
// return 0;
//}
//char* match(char* s, char ch1, char ch2)
//{
// int i = 0, l;
// while (s[i] != ch1)
// { //判断当前位置是否等于跳出条件
// if (s[i] == '\0')
// { //判断是否到字符串结尾
// break;
// }
// s[i] = '\0'; //将前面不符合条件的字符删掉
// i++;
// }
// l = i; //记录第一个符合条件字符位置
// for (i; s[i] != '\0'; i++) { //字符串到结尾时跳出
// printf("%c", s[i]); //打印符合条件字符
// if (s[i] == ch2) {
// break;
// }
// }
// printf("\n");
// return s + l; //将输出定位在第一个 符合条件字符位置 上
//}
//#include <stdio.h>
//#include <string.h>
//#pragma warning(disable:4996)
//#define MAXS 10
//
//char* str_cat(char* s, char* t);
//
//int main()
//{
// char* p;
// char str1[MAXS + MAXS] = { '\0' }, str2[MAXS] = { '\0' };
//
// scanf_s("%s", str1);
// getchar();
// scanf_s("%s", str2);
// p = str_cat(str1, str2);
// printf("%s\n%s\n", p, str1);
//
// return 0;
//}
//
//char* str_cat(char* s, char* t)
//{
// char* p;
// p= strcat(s,t);
// return p;
//}
//#include <stdio.h>
//#include <string.h>
//#include <stdlib.h>
//
//#define MAXN 10
//#define MAXS 20
//
//int max_len(char* s[], int n);
//
//int main()
//{
// int i, n;
// char* string[MAXN] = { NULL };
//
// scanf_s("%d", &n);
// for (i = 0; i < n; i++) {
// string[i] = (char*)malloc(sizeof(char) * MAXS);
// scanf_s("%s", string[i]);
// }
// printf("%d\n", max_len(string, n));
//
// return 0;
//}
//int max_len(char* s[], int n)
//{
// int m = strlen(s[0]);
// for (int i = 1; i < n; i++)
// {
// if (m < strlen(s[i]))
// {
// m = strlen(s[i]);
// }
// }
// return m;
//}

标签:return,int,MAXS,每日,char,++,打卡,include
From: https://www.cnblogs.com/zhaoqianwan/p/17338344.html

相关文章

  • 第七天打卡
    问题:N个有序整数数列已放在一维数组中,利用二分查找法查找整数m在数组中的位置若找到,则输出其下标值;反之,则输出“Notbefound”设计:利用二分查找,寻找此数。流程图 源代码:#include<stdio.h>#defineN10intmain(){ inti,a[N]={1,3,45,67,88,99,101,190},low=0,high=N-1,mid......
  • 第五天打卡
    #include<iostream>usingnamespacestd;intmain(){longlonga[30];intx,i;a[1]=1;a[2]=1;for(x=3;x<=30;x++){a[x]=a[x-1]+a[x-2];}for(i=1;i<=30;i++){printf("%9d",a[i]);if(i%4==0)......
  • 4.20打卡
    一、问题描述:一辆以固定速度行驶的汽车,司机在上午10点看到里程表上的读数是一个对称数(即这个数从左向右读和从右向左读是完全一样的),为95859。两小时后里程表上出现了一个新的对称数,该数仍为五位数。问该车的速度是多少?新的对称数是多少?二、设计思路:根据题意,司机在上午10点看到......
  • 编程打卡:C语言趣味编程习题做
    编程打卡:C语言趣味编程习题做求车速问题描述已知一个对称数里程数,2小时之后它又变成了一个对称数,求速度。设计思路很明显看出来95859的下一个对称数是95959,再下一个对称数是96069,不,还是每次增加,然后再判断对称数吧。流程图graphA[开始]-->B[i=95859+1]-->C[i++]-->D{i......
  • 每日编程一小时(第十一天)
    一.问题描述递归法编写程序求勒让德多项式的值二.设计思路1.数入两个数n,x2.编写一个函数当n==0,p=1;n==1,p==x;n>1,p=((2*n-1)*x*p(n-1,x)-(n-1)*p(n-2,x))/n 返回值为p,实现递归调用3.输出三.流程图 四.程序实现#include<iostream>usingnam......
  • 打卡第四天
    一、问题描述: 若一个三位数等于其各位上数字的立方和,则称这个三位数为水仙花数。编写一个程序,输出所有的水仙花数。输入格式:二、设计思路:枚举三位数x。对x进行按位分离。判断x是否为水仙花数,并输出。三、程序流程图 四、伪代码实现:开始fori=100to999do......
  • 第六天打卡
    1.问题:编写用牛顿迭代法求方程根的函数。方程为a*x*x*x+b*x*x+c*x+d=0,系数a,b,c,d由主函数输入。求x在1附近的一个实根。求出根后,有主函数输出。牛顿迭代法的公式是:x=x0-f(x0)/f'(x0),设迭代到|x-x0|<=1/100000结束。2.思路:定义好x与x0两个变量,通过do-while循环进行迭代,每次循......
  • 每天打卡一小时 第十一天 编译四部曲
     第一部曲自然语言创建函数,对函数进行定义声明第二部曲流程图不用了吧第三部曲代码#include<iostream>usingnamespacestd;classComplex{public:Complex(doubler=0,doublei=0):real(r),imag(i){}Complexoperator+(Complex&c......
  • 打卡第八天
    运用dowhile语句求1~10的和一、1.定义变量n sum用于累加以及输出和2.运用dowhile语句作为累加二、三、#include<iostream>usingnamespacestd;intmain(){ intn=1,sum=0; do{ sum+=n; n++; }while(n<=10); cout<<sum<<endl; return0;} 四、#include<iostr......
  • 第四天打卡
    一、问题描述一辆卡车违反交通规则,撞人之后逃跑。现场有三个目击该事件,但都没有记住车号,只记下车号的一些特征。甲说:牌照的前两位数字是相同的;乙说:牌照的后两位数字是相同的,但与前两位不同的;丙是数学家,他说:四位的车号刚好是一个整数的平方。请根据以上线索求出车号。二、设计......