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 <fstream> | |
#include <iostream> | |
using namespace std; | |
//Output each password is or not acceptable. | |
int main() | |
{ | |
//ifstream cin("easier_done_than_said.txt"); | |
string s; | |
int a,b; //count of consecutive vowels and consonants | |
bool c1,c2,c3,is; //fill rules 1-3 and consecutive or not |
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 <fstream> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
//Searching files by queries ! | |
int main() | |
{ | |
//ifstream cin("file_searching.txt"); | |
int n=0,m=0; |
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 <fstream> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
//Calculate the sum of 2 numbers in Mars. | |
int main() | |
{ | |
//ifstream cin("martian_addition.txt"); | |
string a,b; | |
string s="0123456789abcdefghijk"; //more than 20 ! The key is 'k'. |
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 <fstream> | |
#include <iostream> | |
using namespace std; | |
//Check a matrix if it has the parity property. | |
int main() | |
{ | |
//ifstream cin("error_correction.txt"); | |
int n; | |
while(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 <fstream> | |
#include <iostream> | |
using namespace std; | |
//Is this a daffodil number? | |
int main() | |
{ | |
//ifstream cin("daffodil_number.txt"); | |
int num; | |
while(cin>>num) | |
{ |
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 <fstream> | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
//Arrange from "most sorted" to "least sorted". | |
bool comp(const string &s1, const string &s2) | |
{ | |
string s[]={s1,s2}; | |
int c[]={0,0}; |
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 <fstream> | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
//Is Tom's meadow beautiful now? | |
int main() | |
{ | |
//ifstream cin("beautiful_meadow.txt"); | |
int n,m; |
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 <fstream> | |
#include <iostream> | |
using namespace std; | |
//Transform a RGB image into gray. | |
int main() | |
{ | |
//ifstream cin("image_transformation.txt"); | |
int x,y; | |
int index=1; | |
while(cin>>x>>y) |
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 <fstream> | |
#include <iostream> | |
#include <algorithm> | |
#include <sstream> | |
using namespace std; | |
//Reverse two numbers and add then reverse the sum. | |
int main() | |
{ | |
//ifstream cin("adding_reversed_numbers.txt"); | |
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 <fstream> | |
#include <iostream> | |
using namespace std; | |
//Calculate the difference between this temperature and the previous one. | |
int main() | |
{ | |
//ifstream cin("a_simple_question_of_chemistry.txt"); | |
double a,b; | |
cin>>a; | |
while(cin>>b) |
NewerOlder