wklejamy.pl website for sale. You are interested in. Please contact. wklejamy@gmail.com

Click to buy coffe
avatar
Untitled

Guest 493 3rd Apr, 2023

CPP 0.95 KB
                                           
                         #include <iostream>
#include <fstream>
using namespace std;
bool czy_pot_2(int a)
{
	for(int i=1;i<=2048;i*=2)
	{
		if(i==a) return true;
		else if(i>a) return false;
	}
}

bool podzial(string s)
{
	string temp;
	for(int i=0;i<s.size();i+=2)
	{
		if(s[i]=='B' && s[i+1]=='D') temp.push_back('A');
		else if(s[i]=='C' && s[i+1]=='A') temp.push_back('B');
		else if(s[i]=='C' && s[i+1]=='D') temp.push_back('B');
		else if(s[i]=='D' && s[i+1]=='D') temp.push_back('C');
		else if(s[i]=='B' && s[i+1]=='C') temp.push_back('D');
		else return true;
	}
	if(temp.size()==1) return false;
	return podzial(temp);
}
int main()
{
	string s;
	int suma=0;
	ifstream plik("genetyka_1.txt");
	{
		while(plik>>s)
		{
			
			suma+=podzial(s);//cout<<s<<" "<<suma<<"\n";
		}
	}
	cout<<suma;
	return 0;
}
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Ta strona używa plików cookie w celu usprawnienia i ułatwienia dostępu do serwisu oraz prowadzenia danych statystycznych. Dalsze korzystanie z tej witryny oznacza akceptację tego stanu rzeczy.
Wykorzystywanie plików Cookie
Jak wyłączyć cookies?
ROZUMIEM