-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
84 changed files
with
763 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include<stdio.h> | ||
#include<string.h> | ||
int main() | ||
{ | ||
char s[1001],t[1001]; | ||
scanf ("%s %s",s,t); | ||
int lenS=strlen(s); | ||
int lenT=strlen(t); | ||
printf("%d %d\n",lenS,lenT); | ||
printf("%s %s\n",s,t); | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include<stdio.h> | ||
#include<string.h> | ||
int main() | ||
{ | ||
char a[1000001]; | ||
fgets(a,1000001,stdin); | ||
int i=0; | ||
while(a[i]!='\\') | ||
{ | ||
printf("%c",a[i]); | ||
i++; | ||
} | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
int main() | ||
{ | ||
char a[11], b[11]; | ||
scanf("%s\n%s", a, b); | ||
int lenA = strlen(a); | ||
int lenB = strlen(b); | ||
printf("%d %d\n", lenA, lenB); | ||
strcat(a, b); | ||
printf("%s\n", a); | ||
int temp = a[0]; | ||
a[0] = b[0]; | ||
b[0] = temp; | ||
for (int i = 0; i < lenA; i++) | ||
{ | ||
printf("%c", a[i]); | ||
a[0] = b[0]; | ||
} | ||
printf(" "); | ||
for (int i = 0; i < lenB; i++) | ||
{ | ||
printf("%c", b[i]); | ||
b[0] = temp; | ||
} | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
int main() | ||
{ | ||
char a[1000001]; | ||
scanf("%s", a); | ||
int sum = 0; | ||
for (int i = 0; i < strlen(a); i++) | ||
{ | ||
sum += (a[i] - '0' ); | ||
} | ||
printf("%d", sum); | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
int main() | ||
{ | ||
int n; | ||
scanf("%d",&n); | ||
for(int i=0;i<n;i++) | ||
{ | ||
char ch[102]; | ||
scanf("%s",ch); | ||
int sz=strlen(ch); | ||
|
||
if (sz>10) | ||
{ | ||
printf("%c%d%c\n",ch[0],sz-2,ch[sz-1]); | ||
} | ||
else | ||
{ | ||
printf("%s\n",ch); | ||
} | ||
|
||
} | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
int main() | ||
{ | ||
char a[100001]; | ||
scanf("%s",a); | ||
int sz=strlen(a); | ||
|
||
for(int i=0;i<sz;i++) | ||
{ | ||
if(a[i]==',') | ||
{ | ||
printf(" ",a[i]); | ||
} | ||
if(a[i]>=65 && a[i]<=90) | ||
{ | ||
printf("%c",a[i]+32); | ||
} | ||
if(a[i]>=97 && a[i]<=122) | ||
{ | ||
printf("%c",a[i]-32); | ||
} | ||
} | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// #include<stdio.h> | ||
// #include<string.h> | ||
// int main() | ||
// { | ||
// char a[1001]; | ||
// scanf("%s",a); | ||
// int sz=strlen(a); | ||
// for(int i=0;i<sz;i++) | ||
// { | ||
// if(a[i]==a[sz-i-1]) | ||
// { | ||
// printf("YES"); | ||
// } | ||
// else | ||
// { | ||
// printf("NO"); | ||
// } | ||
// } | ||
// return 0; | ||
// } | ||
|
||
#include<stdio.h> | ||
#include<string.h> | ||
int main() | ||
{ | ||
char a[1001]; | ||
scanf("%s",a); | ||
int sz=strlen(a); | ||
|
||
for(int i=0;i<=sz/2;i++) | ||
{ | ||
if(a[i]!=a[sz-i-1]) | ||
{ | ||
printf("NO\n"); | ||
return 0; | ||
} | ||
|
||
} | ||
printf("YES"); | ||
return 0; | ||
} | ||
|
||
|
||
// #include<stdio.h> | ||
// #include<string.h> | ||
// int main() | ||
// { | ||
// char a[1001]; | ||
// scanf("%s",a); | ||
// int sz=strlen(a); | ||
// for(int i=0;i<sz/2;i++) | ||
// { | ||
// printf("i=%d sz-i-1 = %d\n",i, sz-i-1); | ||
// if(a[i]!=a[sz-i-1]) | ||
// { | ||
// printf("NO\n"); | ||
// return 0; | ||
// } | ||
// } | ||
// printf("YES\n"); | ||
// return 0; | ||
// } |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <stdio.h> | ||
#include <limits.h> | ||
int main() | ||
{ | ||
int n; | ||
scanf("%d", &n); | ||
int a[n]; | ||
for (int i = 0; i < n; i++) | ||
{ | ||
scanf("%d",&a[i]); | ||
} | ||
int min =INT_MAX; | ||
int minindex=0; | ||
int max =INT_MIN; | ||
int maxindex=0; | ||
for (int i = 0; i < n; i++) | ||
{ | ||
if (a[i] < min) | ||
{ | ||
min = a[i]; | ||
minindex=i; | ||
} | ||
} | ||
for (int i = 0; i < n; i++) | ||
{ | ||
if (a[i] > max) | ||
{ | ||
max = a[i]; | ||
maxindex=i; | ||
} | ||
} | ||
a[minindex]=max; | ||
a[maxindex]=min; | ||
for (int i = 0; i < n; i++) | ||
{ | ||
printf("%d ", a[i]); | ||
} | ||
|
||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include<stdio.h> | ||
int main() | ||
{ | ||
char ar[5]; | ||
for(int i=0;i<5;i++) | ||
{ | ||
scanf("%c",&ar[i]); | ||
} | ||
for(int i=0;i<5;i++) | ||
{ | ||
printf("%c\n",ar[i]); | ||
} | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include<stdio.h> | ||
int main() | ||
{ | ||
char a[6]="Rahat\0"; | ||
printf("%s",a); | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include<stdio.h> | ||
int main() | ||
{ | ||
char a[6]; | ||
scanf("%s",a); | ||
printf("%s\n",a); | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
abc | ||
de |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include<stdio.h> | ||
#include<string.h> | ||
int main() | ||
{ | ||
char a[100]; | ||
fgets(a,20,stdin); | ||
a[17]='\0'; | ||
printf("%s",a); | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include<stdio.h> | ||
#include<string.h> | ||
int main() | ||
{ | ||
char a[100]; | ||
scanf("%s",a); | ||
// int count=0; | ||
// int i=0; | ||
// while (a[i]!='\0') | ||
// { | ||
// count++; | ||
// i++; | ||
// } | ||
// printf("%d",count); | ||
int st=strlen(a); | ||
printf("%d",st); | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
3 2 | ||
abcde | ||
dbcde ae |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include<stdio.h> | ||
#include<string.h> | ||
int main() | ||
{ | ||
// char a[10000001]; | ||
// scanf("%s",a); | ||
char a; | ||
int cnt[26]={0}; | ||
while((a = getchar()) != EOF) | ||
{ | ||
int val= a- 'a'; | ||
cnt[val]++; | ||
} | ||
for(int i=0;i<26;i++) | ||
{ | ||
if(cnt[i]!=0) | ||
{ | ||
printf("%c : %d\n",i+'a',cnt[i]); | ||
} | ||
} | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include<stdio.h> | ||
#include<string.h> | ||
int main() | ||
{ | ||
int n,m; | ||
scanf("%d %d",&n,&m); | ||
int a[n]; | ||
for(int i=0;i<n;i++) | ||
{ | ||
scanf("%d ",&a[i]); | ||
} | ||
int cnt[100001]={0}; | ||
for(int i=0;i<n;i++) | ||
{ | ||
int val=a[i]; | ||
cnt[val]++; | ||
} | ||
for(int i=0;i<n;i++) | ||
{ | ||
printf("%d\n",cnt[i]); | ||
} | ||
return 0; | ||
} |
Binary file not shown.
Oops, something went wrong.