Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154546 万骏博 指针遍历字符串 C++ Accepted 1 MS 264 KB 234 2026-05-30 16:44:18

Tests(2/2):


Code:

#include<bits/stdc++.h> using namespace std; char s[100],c=' '; int b=0; int main(){ cin>>s; int a=strlen(s); char*p=s; c=s[a-1]; for(int i=0;i<=a-1;i++){ if(*p==c){ b++; } p++; } cout<<b; return 0; }