Useful Contents

May be there are many sources to gain knowledge or logic or hints,

I am trying to give some links,if there is anything i forget ,please help me to add!

Google

Stack Overflow

Shafaet’s Planet

 

Advertisements

Delete File

#include<stdio.h>
int main()

{
int status;
char file[12];
printf(“Delete file: “);
gets(file);
status=remove(file);
if(status==0)
printf(“Deleted\n”);
else
{

printf(“Unable to delete\n”);
perror(“ERROR”);
}
}

707A. Brain’s Photos

Problem Link

<Source Code>

#include<stdio.h>
#include<string.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i,s=0,co=0,j,n,m;

     cin >> n >> m;char o;

for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cin >> o;
if(o=='C' ||o=='M' ||o=='Y')
    s=1;
}
}
if(s)
printf("#Color\n");
else printf("#Black&White\n");
}

 

678 C. Joty and Chocolate

Problem Link

<Source Code>

#include<stdio.h>

int gcd(long long int n1,long long int n2)
{
return (n2!=0)?gcd(n2,n1%n2):n1;
}
long long lcm(long long a,long long b)
{
    return (a/gcd(a,b))*b;
}
int main()
{
long long n,a,b,p,q,ans=0;
scanf("%lld %lld %lld %lld %lld",&n,&a,&b,&p,&q);
ans+=(n/a)*p;
ans+=(n/b)*q;
ans-=(n/lcm(a,b))*(p>q?q:p);
printf("%lld\n",ans);
}