السابق التالي
0 / 23
الوحدة النمطية DEMO-32-108DEMO-C-32

Most Frequent

DEMO-C-32 • Programming in C

Browser-only practice

بيان المشكلة

Write a program that finds the character that appears most frequently in a string. If there is a tie, pick the one with the smallest ASCII value.

قيود

Max string length: 100

تنسيق الإدخال

Input:

String S

تنسيق الإخراج

Output:

Char

حالات اختبار نموذجية

Submit runs every public testcase in this browser. Results and code never leave this device.

العينة رقم 1
عينة ظاهرة
Quince?8
8
The most frequent character in Quince?8 is 8.
العينة رقم 2
عينة ظاهرة
Code#7
#
The most frequent character in Code#7 is #.
العينة رقم 3
عينة ظاهرة
Desktop?6
6
The most frequent character in Desktop?6 is 6.
العينة رقم 4
عينة ظاهرة
Fix#5
#
The most frequent character in Fix#5 is #.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
إعدادات المحرر