You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AOC2022/03/test.cpp

29 lines
480 B

#include <iostream>
using namespace std;
int intoPriority(char ch)
{
int initalP = ch;
if (initalP < 97)
{
initalP -= 38;
} else {initalP -= 96;}
return initalP;
}
int main()
{
string lo {"abcdefghijkmnopqrtsuvwxyx"};
string up {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
for (string letters: {lo, up})
{
for (char ch: letters)
{
cout << ch << '\t' << int(ch) << '\t' << intoPriority(ch) << endl;
}
}
}