Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- struct combinacao
- {
- string nomeCor;
- string cor1;
- string cor2;
- string tipo;
- };
- int main()
- {
- //cores usadas cor gerada tipo da cor
- string combinacoes[9][4] = {"yellow", "orange", "yellow-orange", "tertiary",
- "red", "orange", "red-orange", "tertiary",
- "red", "violet", "red-violet", "tertiary",
- "blue", "violet", "blue-violet", "tertiary",
- "blue", "green", "blue-green", "tertiary",
- "yellow", "green", "yellow-green", "tertiary",
- "blue", "yellow", "green", "secondary",
- "yellow", "red", "orange", "secondary",
- "red", "blue", "violet", "secondary"
- };
- combinacao cor[9];
- for (int i = 0; i < 9; i++)
- {
- for (int j = 0; j < 4; j++)
- {
- cor[i].nomeCor = combinacoes[i][2];
- cor[i].cor1 = combinacoes[i][1];
- cor[i].cor2 = combinacoes[i][0];
- cor[i].tipo = combinacoes[i][3];
- }
- }
- string cor1, cor2;
- // ======= edite a partir daqui =======
- cout<< "Digite a primeira cor: ";
- cin>>cor1;
- cout<< "Digite a segunda cor: ";
- cin>>cor2;
- for(int i=0; i<9; i++)
- {
- if(cor[i].cor1 ==cor1 && cor[i].cor2 == cor2)
- {}
- else if(cor[i].cor1 == cor2 && cor[i].cor2 == cor1)
- {
- cout << "A combinação gera a cor:" << cor[i].nomeCor << endl;
- cout << "A combinação gerada eh do tipo:"<<cor[i].tipo << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement