পোস্টগুলি

সেপ্টেম্বর, ২০১৯ থেকে পোস্টগুলি দেখানো হচ্ছে

Dictionaries and Maps

Dictionaries and Maps:  problems link :   Dictionaries and Maps code:  #include<stdio.h> #include<stdlib.h> #include<string.h> int main() {     char ins[100000][50],inc[50];     int intp[100000];     int i,j,n;     scanf("%d",&n);     for(i=0;i<n;i++)         scanf("%s %d%*c",ins[i],&intp[i]);     for(i=0;i<n;i++)     {         scanf("%s%*c",inc);         for(j=0;j<n;j++)         {             if(strcmp(ins[j],inc)==0)             {                 printf("%s=%d\n",inc,intp[j]);     ...

Leonardo's Prime Factors

Problems: Link of this problems where range <1000000000 code: #include<stdio.h> int next_prime(int n) {     int i;     for(i=2;i<n;i++)     {         if(n%i==0)             break;     }     if(i==n)         return n;     else         return next_prime(n+1); } int main() {     int T,s,cou=0;     unsigned long long int p,n;     scanf("%d",&T);     while(T--)     {         scanf("%lld",&n);         p=2;         s=2;         cou=0;         while(n>=p)   ...

Piramide Model

Piramide Model: Output: 7             1           2 3 2         3 4 5 4 3       4 5 6 7 6 5 4     5 6 7 8 9 8 7 6 5   6 7 8 9 0 1 0 9 8 7 6 7 8 9 0 1 2 3 2 1 0 9 8 7 code: #include<stdio.h> int main() {     int row,start=1,digit,i,j;     scanf("%d",&row);     for(i=1;i<=row;i++)     {         for(j=1;j<=(row-i)*2;j++)             printf(" ");         for(j=1,digit=start;j<=i;j++,digit++)             printf("%d ",digit%10);         digit-=2;         while(digit>=start) ...

Sub string number

Sub string number: code: #include<stdio.h> int main() {     char s1[50],s2[50];     int i,j,k,sn=0;     gets(s1);     fflush(stdin);     gets(s2);     for(i=0;s1[i]!='\0';i++)     {         if(s1[i]==s2[0])         {             for(j=i+1,k=1;s2[k]!='\0';k++,j++)             {                 if(s1[j]!=s2[k])                     break;             }             if(s2[k]=='\0')        ...