first semester files

This commit is contained in:
2024-02-22 14:31:08 -05:00
parent 0f26c9f73d
commit 2d4bbf49a4
242 changed files with 360411 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#include <iostream>
#include <string>
using namespace std;
int main()
{
string num;
cin >> num;
int decimal = num.find( '.' );
//remove decimal point
if ( decimal >= 0)
num.erase( '.' );
else
//remove trailing zeroes
while (num.back() == '0')
num = num.substr( num.length() - 1 );
//remove leading zeros
while (num.front() == '0')
num = num.substr(1);
cout << num.length();
return 0;
}