当前位置:网站首页>Exercise 7-10 finding specified characters (15 points)
Exercise 7-10 finding specified characters (15 points)
2022-06-13 09:25:00 【Hezeze】


#include <stdio.h>
int main () {
int i=0,ret;
char ch;
int flag=0;
char a[81];
scanf ("%c\n",&ch);
gets (a);
for (i=0;a[i]!='\0';i++) {
if (a[i]==ch) {
ret=i;
flag=1;
}
}
if (flag==1) {
printf ("index = %d",ret);
} else {
printf ("Not Found");
}
return 0;
}
边栏推荐
- LeetCode 5289. Fair distribution of cookies (DFS)
- 20211108 is transpose multiply a a a positive definite matrix? What are the necessary and sufficient conditions for a to be a positive definite matrix?
- Zigzag transformation
- 计算两个时间相差的天数(支持跨月、跨年)
- 7-3 virus traceability (20 points)
- Tutorial (5.0) 04 Fortint cloud services and scripts * fortiedr * Fortinet network security expert NSE 5
- BGP 联邦+Community
- Simulink variant model and variant subsystem usage
- LeetCode 343. integer partition
- LeetCode 201. 数字范围按位与
猜你喜欢

C language: file operation

acwing 786. Number k

C language: Simulated Implementation of library function strcpy

(Dijkstra + shortest circuit + by point n^2) acwing 849 Dijkstra finding the shortest path I

C language: deep understanding of pointers and arrays

全新BMW i3的操控,能符合对3系之名产品的期待吗?

C language: recursive function to realize Hanoi Tower

Tutorial (5.0) 04 Fortint cloud services and scripts * fortiedr * Fortinet network security expert NSE 5

Alibaba senior experts analyze the standard design of protocol

Cisco, Huawei network equipment
随机推荐
(dfs+ pruning + checkerboard problem +dood) acwing 843 N-queen problem
IP address introduction
SQL ROW_ The number() function uses
QML(06)——qml. Add a new folder under QRC
JUC atomic reference and ABA problem
LeetCode 6095. Strong password checker II
LeetCode 5289. Fair distribution of cookies (DFS)
谨记! 写代码别太自信! 一定要写点关键日志info输出,不然问题都定位不到。
C language: file operation
Jenkins access openldap user authentication
SpEL表达式 简单使用
LeetCode 6097. Match after replacing characters (Dictionary)
Use typescript to complete simple snake eating function
JUC Unsafe
LeetCode 6097. 替换字符后匹配(字典)
Remember! Don't be too confident in writing code! Be sure to write some key log info output, or the problem will not be located.
Musk's "meta universe" dream
Delete soft link
Immutability of shared model
(tree DP) acwing 285 A dance without a boss