Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- bool isHydroxide(char compound[])
- {
- char char1;
- char char2;
- for (int i = 1; compound[i] != 0; i++)
- {
- char1 = compound[i - 1];
- char2 = compound[i];
- }
- return (char1 == 'O' && char2 == 'H');
- }
- int main()
- {
- char compound[81];
- std::cout << "Introduza o composto.";
- std::cin >> compound;
- if (isHydroxide(compound))
- std::cout << "fixe";
- else
- std::cout << "notfixe";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement