#include< bits/stdc++.h > using namespace std; | |
int main() { | |
int t; | |
string s; | |
cin >> t; | |
while(t--) { | |
int ar[256]= {0}; | |
cin >> s; | |
for(char ch : s){ | |
ar[ch]++; | |
} | |
for(char ch = 'a' ; ch <= 'z';ch++ ) { | |
if(ar[ch] > 0) cout << ch << " = " << ar[ch] << endl; | |
} | |
if(t>=1)cout << endl; | |
} | |
return 0; | |
} |
Sunday, October 13, 2019
Dimik oj - 15 - অক্ষর গণনা
Dimik oj - 16 - শব্দ বিপর্যয় python3 solution
test = int(input())
for i in range(test):
sentence = input().split(' ')
res = []
for x in sentence:
word = "".join(reversed(x))
res.append(word) #res.append(x[::-1])
print(' '.join(res))
Dimik oj - 14 অক্ষর গণনা python3 solution
if __name__ == '__main__':
n = int(input())
for i in range(n):
s = input().strip()
rs = sorted(list(set(s)))
for x in rs:
cnt = s.count(x)
print("%c = %d" %(x,cnt))
if i < n-1:
print()
n = int(input())
for i in range(n):
s = input().strip()
rs = sorted(list(set(s)))
for x in rs:
cnt = s.count(x)
print("%c = %d" %(x,cnt))
if i < n-1:
print()
Dimik oj - 14 অক্ষরের ঘনঘটা python3 solution
if __name__ == '__main__':
t = int(input())
for i in range(t):
s = input()
ch = input()
ans = s.count(ch)
if ans > 0:
print("Occurrence of '%c' in '%s' = %d" %(ch,s,ans))
else:
print("'%c' is not present"% ch)
Dimik oj - 14 অক্ষরের ঘনঘটা
#include < bits/stdc++.h >
using namespace std;
int main() {
int t;
string s;
char ch;
scanf("%d ",&t);
while(t--) {
getline(cin , s);
scanf("%c ",&ch);
size_t n = count(s.begin(), s.end(), ch);
if(n > 0){
cout << "Occurrence of " << "'" << ch <<"'" << " in '"
<< s << "' = " << n << endl;
}else {
cout << "'" << ch << "' is not present" << endl;
}
}
return 0;
}
Dimik oj - 12 ফ্যাক্টরিয়াল 100 python3 solution
import math | |
if __name__ == '__main__': | |
tc = int(input()) | |
for i in range(tc): | |
k = int(input()) | |
ans = 0 | |
while k > 0: | |
ans += k//5 | |
k //= 5 | |
print(ans) |
Dimik oj - 12 ফ্যাক্টরিয়াল 100
#include < iostream >
using namespace std;
int main() {
int n, t;
cin >> n;
while(n--) {
cin >> t;
int ans = 0;
while(t > 0) {
ans += t/5;
t/=5;
}
cout << ans << endl;
}
return 0;
}
Subscribe to:
Posts (Atom)