当前位置:网站首页>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 72. Edit distance
- C language: recursive function to realize Hanoi Tower
- Immutability of shared model
- (dfs+ pruning + checkerboard problem +dood) acwing 843 N-queen problem
- 谨记! 写代码别太自信! 一定要写点关键日志info输出,不然问题都定位不到。
- Opencv face recognition of ros2 foxy~galactic~humble
- Dynamic display of analog clock using digital clock in turtle Library
- 20220606 Young's inequality for Matrices
- (Dijkstra + shortest circuit + by point n^2) acwing 849 Dijkstra finding the shortest path I
- 时间戳转localDate
猜你喜欢

turtle库的使用数字时钟模拟时钟动态显示

(tree DP) acwing 285 A dance without a boss

acwing 786. Number k

C language: dynamic memory management

C language: Simulated Implementation of library function strcpy
![1-2 24:00 (20 points) [CSP certification true question]](/img/3b/fe2c0e46dca604e5906d9c5ceabbe3.jpg)
1-2 24:00 (20 points) [CSP certification true question]

Solov2 source code analysis

Use typescript to complete simple snake eating function

Simulink variant model and variant subsystem usage

全新BMW i3的操控,能符合对3系之名产品的期待吗?
随机推荐
Exploitation of competitive loopholes in attacking and defending world PWN play conditions
LeetCode 72. 编辑距离
LeetCode 201. 数字范围按位与
1-2 24:00 (20 points) [CSP certification true question]
I have summarized the knowledge points of JS [intermediate and advanced] for you
HAProxy + Keepalived实现MySQL的高可用负载均衡
线上调试工具Arthas基础
C # introductory series (XIII) -- getting to know the structure for the first time
(dfs+ tree DP) acwing 846 Center of gravity of tree
(bfs) acwing 844. Labyrinth
(Dijkstra + shortest circuit + by point n^2) acwing 849 Dijkstra finding the shortest path I
Yolov5 model evaluation
Simple implementation of database link pool
The turtle library displays the system time
BGP Federation +community
CAS无锁
批量读取文件夹下的全部语音文件
LeetCode 202. 快乐数
JUC atomic reference and ABA problem
LeetCode 5289. Fair distribution of cookies (DFS)