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
#include<stdio.h> | |
#include<stdlib.h> | |
#include<string.h> | |
//player 0=max; | |
//player 1=min; | |
//your symbol=X; | |
//comp symbol=O; | |
struct pair{ | |
int move; |
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
#include<stdio.h> | |
int main() | |
{ | |
int n,w,h,i,t; | |
scanf("%d",&t); | |
scanf("%d",&n); | |
for(i=1;i<=n;i++) | |
{ | |
scanf("%d %d",&w,&h); | |
if(w>=t&&h>=t) |
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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
// cout << "Hello World!" << endl; | |
long long n,sum=1; | |
cin>>n; | |
for(int i=1;i<=n;i++) sum *= i; | |
cout<<sum; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int t; | |
cin>>t; | |
while(t--){ | |
int n; | |
cin>>n; |
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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int n; | |
scanf("%d",&n); | |
while(n!=42) | |
{ | |
printf("%d\n",n); |
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
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int prime[] = {67,71,73,79,83,89,97,101,103,107,109,113}; | |
int t; | |
cin>>t; | |
while(t--){ | |
int n; |
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
#include<bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
//cout << "Hello World!" << endl; | |
//vector<int> prime; | |
int n; | |
cin>>n; | |
int p=2; |
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
#!/bin/bash | |
c=2 | |
a=1 | |
b=1 | |
d=0 | |
echo "enter the number of elements" | |
read n | |
echo "$a" | |
echo "$b" | |
while((c<n)) |
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
#!/bin/bash | |
factorial() | |
{ | |
ans=$1 | |
if((ans<=2)); then | |
echo $ans | |
else | |
f=$((ans-1)) | |
f=$(factorial $f) | |
f=$((f*ans)) |
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
#!/bin/bash | |
echo "enter 5 digit number" | |
read number | |
n=1 | |
while((n<=5)) | |
do | |
a=`echo $number | cut -c $n` | |
echo -n "$a" | |
n=`expr $n + 2` | |
done |
NewerOlder