CodeMarshal Solution সংখ্যা গণনা (Counting Numbers) - In C++
CodeMarshal Online Judge Solution সংখ্যা গণনা (Counting Numbers)
CodeMarshal Main Problem Link - https://algo.codemarshal.org/problems/556b62679c5e850300c49cb5
Problem Name: CodeMarshal Problem সংখ্যা গণনা (Counting Numbers)
Problem Number : CodeMarshal Problem সংখ্যা গণনা (Counting Numbers)
Online Judge : CodeMarshal Online Judge Solution
Solution Language : C++
CodeMarshal সংখ্যা গণনা (Counting Numbers) Solution Code in C:
#include<iostream> using namespace std; int main() { int testcase; cin >> testcase; for(int i = 1; i <= testcase; i++) { int n, c[101] = {0}, tmp; cin >> n; for(int j = 0; j < n; j++) { cin>>tmp; c[tmp]++; } int h = 0,m; for(int j = 0; j <= 100; j++) { if(c[j] >= h) { h = c[j]; m = j; } } cout<<"Case "<< i <<": "<< m <<" "<< h <<endl; } }
Tag : CodeMarshal Solution in C, Counting Numbers solution of CodeMarshal, Codemarshal solution, Codemarshal Online Judge Solution, Counting Number Solution
No comments:
Post a Comment