#include<stdio.h> #include<string.h> int main() { int l,i,j,count=0; char s[100000]; while(gets(s)) { l=strlen(s); for(i=0;i<l;i++) { switch(s[i]) { case 'b': { for(j=0;j<count;j++) printf(" "); count=0; break; } case '1':...
#include<stdio.h> #include<string.h> int main() { int l,i,j,count=0; char s[100000]; while(gets(s)) { l=strlen(s); for(i=0;i<l;i++) { switch(s[i]) { case 'b': { for(j=0;j<count;j++) printf(" "); count=0; break; } case '1':...
#include <bits/stdc++.h> int main() { char s[105]; while(gets(s)) { printf("%s",s); } return 0; }
#include <stdio.h> #define N 10000000 typedef long long LL; using namespace std ; LL primes[N]; //bool flag[N]; void sieve(LL n) { for(LL i=4; i<=n; i+=2) { primes[i]=1; } //LL p=(LL)sqrt(n); for(LL i=3; i*i<=n; i+=2) { if(primes[i]) continue;...
#include <bits/stdc++.h> using namespace std; char s[100000],t[100000]; int main() { int i,j; bool flag; while(scanf("%s %s",s,t)!=EOF) { flag=false; for(j=0,i=0;t[i]!='\0';i++) { if (s[j] == t[i]) j++; if (s[j] == '\0') { flag = true; break; } }...
#include <bits/stdc++.h> using namespace std; int main() { int a,b,c,d,res; while(cin>>a>>b>>c>>d) { if(a==0 and b==0 and c==0 and d==0) break; res=1080; res += (a > b) ? (a - b) * 9 : (a - b + 40) * 9; res += (c > b) ? (c - b) * 9...
#include <bits/stdc++.h> using namespace std; int main() { int x,y,k,n,i,KK,X[10005],Y[10005]; bool f; KK=0; while(cin>>k) { KK=0; //X[105]=Y[105]={0}; memset(X, 0, sizeof(X[0]) * 10005); memset(Y, 0, sizeof(Y[0]) * 10005); for(y= 2*k ; y!=k;...
#include <bits/stdc++.h> #include <algorithm> #include <vector> #include <map> #include <iostream> using namespace std; #define SIZE(a) ((int)a.size()) #define FOREACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i !=...
#include <bits/stdc++.h> using namespace std; int main() { int a[150],i,j,tc,n,sum; cin>>tc; while(tc--) { sum=0; cin>>n; for(i=0;i<n;i++) cin>>a[i]; sort(a,a+n); for(i=0;i<n-1;i++) sum+=abs(a[i]-a[i+1]); sum*=2;...
#include <bits/stdc++.h> using namespace std; int main ( ) { char arr[101],a[101], b[101],c[101],d[101], e[101],f[101],g[101], h[101],in[101], jn[101]; int val,i, tc,cases = 1 ; cin>>tc; while (tc--) { scanf ( "%s %d" , a ,&arr[0]); scanf ( "%s...
#include <bits/stdc++.h> using namespace std; int main() { char s[2001]; int cases=1,l; while(scanf("%s",s)) { if(strcmp(s,"#")==0) break; if(strcmp(s,"HELLO")==0) printf("Case %d: ENGLISH\n",cases++); else if(strcmp(s,"HOLA")==0) printf("Case %d:...
#include <bits/stdc++.h> using namespace std; int main() { int tc,cases=1,n,a[1001],give,given,egl; while(cin>>n) { give=0,given=0; if (n==0) break; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++) if(a[i]==0) give++; else...
#include <bits/stdc++.h> using namespace std; int main() { char s[101],l; int i,tc,ans; cin>>tc; while(tc--) { scanf("%s",s); l=strlen(s); if(l<=3) { if(s[0] =='o'&&s[1]=='n'&& s[2] == 'e' || s[0] == 'o' && s[1] == 'n' ||...
#include <bits/stdc++.h> using namespace std; int main() { char s[150]; int tc,a,sum=0,amount; cin>>tc; while(tc--) { scanf("\r"); scanf("%s",s); if(strcmp(s,"donate")== 0) { cin>>amount; sum+=amount; //printf("%d\n",sum); } else...
#include <bits/stdc++.h> using namespace std; int main() { int a,b,ans; while(cin >> a >> b) { if(a==-1 and b==-1) break; ans=abs(a-b); if(ans>50) ans=100-ans; cout<<ans<<endl; } return 0; }...
#include <bits/stdc++.h> using namespace std; int main() { char s[10]; int cases=1; while(scanf("%s",s)) { if(strcmp(s,"*")==0) break; else if( strcmp(s,"Hajj")== 0) printf("Case %d: Hajj-e-Akbar\n",cases++); else printf("Case %d:...
#include<bits/stdc++.h> using namespace std; int tc=1,position=0; int bfs(int src, int TTL,map <int, vector<int> > edges) { map<int,int> visited,level; int unreach=0; queue<int>Q; Q.push(src); position=1; visited[src]=1;...
#include <cstdio> #include <vector> #include <queue> using namespace std; typedef vector<int> vi; int main() { int V, E, u, v; vector<vi> AdjList; while (scanf("%d", &V), V) { AdjList.assign(V, vi()); scanf("%d",...
#include <bits/stdc++.h> #include <string> #include <vector> #include <map> using namespace std; int main() { string s; int frequency=0; vector<string>vec; while(getline(cin,s)) { v.push_back(s); frequency=max(frequency,(int)s.length());...
#include <iostream> #include <string> #include <sstream> #include <vector> using namespace std; int main() { stringstream ss; string line1,line2; vector<int>A,B; int i,j,ch; while(getline(cin,line1) && getline(cin,line2)) {...
#include <bits/stdc++.h> #include <string.h> #include <map> using namespace std; int main() { string s; //map<char,int>m; // map<char,int>::iterator it; while(getline(cin,s)) { map<char,int>m; int mxfrq=0; int len=s.size(); for(int...
The world of AI evolves at lightning speed. Discover why staying informed on the latest AI news, breakthroughs, and industry trends is essential for everyone.
Stay ahead in web development with a weekly dive into PHP news, articles, events, and essential links. Discover the power of continuous learning for PHP professionals.
Explore Python’s exciting future! Discover anticipated trends, innovations, and what upcoming releases like Python 3.13 and 3.14 mean for developers and data scientists.
Get ready for Java 25! The September 2025 Inside Java Newsletter is packed with technical videos, Java User Group updates, and essential developer event news. Stay ahead with the latest Java innovations.