Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154545 万骏博 指针遍历字符串 C++ Wrong Answer 1 MS 276 KB 232 2026-05-30 16:36:23

Tests(0/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]; for(int i=a-2;i>=1;i--){ if(*(p-i)==c){ b++; } } cout<<b+1; return 0; }


Run Info:

------Input------
aaaaaaaaaaabba
------Answer-----
12
------Your output-----
13