Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 3 / Contains5.cpp
blob: 78d13f04615cedd78ea25e8e6e851d32f660d572 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>

using namespace std;

int main()
{
	int n;
	cin >> n;

	bool foundFive = false;
	while (n != 0)
	{
		int lastDigit = n % 10;
		if (lastDigit == 5)
		{
			foundFive = true;
			break;
		}
		n /= 10;
	}
	
	if (foundFive)
	{
		cout << "yes";
	}
	else
	{
		cout << "no";
	}
	

}