找第一个只出现一次的字符,不使用复杂函数的简单解法 摘要:题目说了输入的字符串仅有小写字母,那么可以定义一个数据元素个数为26的整型数组,用于记录各个字符出现的次数,出现次数为1的即为答案,没有则输出no ```cpp #include #inclu…… 题解列表 2024年03月28日 1 点赞 0 评论 543 浏览 评分:0.0
2847: 找第一个只出现一次的字符 摘要:参考代码:s = input() for i in s: if s.count(i) == 1: print(i) break else: &nbs 题解列表 2024年03月23日 0 点赞 0 评论 369 浏览 评分:0.0
找第一个只出现一次的字符 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <string.h>int main() { char arr[200] = { 0 }; fgets(arr, s…… 题解列表 2024年09月26日 0 点赞 0 评论 347 浏览 评分:0.0
STL unordered_set完美解决问题 摘要:解题思路:把字符串中只出现一次的字符保存到set里。注意事项:题意要求输出第一次出现字符,所以需要遍历两次字符串。参考代码:#include <iostream>#include <string>#i…… 题解列表 2024年04月19日 0 点赞 0 评论 341 浏览 评分:0.0
HashMap键值对方法 摘要:解题思路:注意事项:参考代码:import java.util.HashMap;import java.util.Map;import java.util.Scanner;public class M…… 题解列表 2024年04月22日 0 点赞 0 评论 345 浏览 评分:0.0
七行简便 编写题解 2847: 找第一个只出现一次的字符 摘要:解题思路:if n.count(i)==1:注意事项:else: print('no')参考代码:n=input()for i in n: if n.count(i)==1:…… 题解列表 2024年04月24日 0 点赞 0 评论 546 浏览 评分:0.0
使用unordered_map解题 摘要:解题思路:充分利用STL容器的特性-unordered_map, 对其进行存放和计算 得出第一个个数为1的小写字母注意事项: 参考代码:#include<bits/stdc++.h>char sear…… 题解列表 2024年11月30日 1 点赞 0 评论 376 浏览 评分:0.0
找第一个只出现一次的字符 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] args) {…… 题解列表 2024年06月03日 0 点赞 0 评论 354 浏览 评分:0.0
题目 2847: 找第一个只出现一次的字符 摘要:参考代码:#include <stdio.h>#include <stdlib.h>#include <string.h>int main(){ char b,a[100000]; int…… 题解列表 2023年11月06日 0 点赞 0 评论 209 浏览 评分:0.0
找第一个只出现一次的字符 摘要:解题思路:写题解代码只是为了自己查看,无严谨性注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ char s[100000]; …… 题解列表 2024年11月06日 0 点赞 0 评论 491 浏览 评分:0.0