Untitled
unknown
c_cpp
2 years ago
609 B
6
Indexable
using namespace std;
#include <iostream>
#include <iostream>
#include <stdio.h>
#include <string>
void caps(string& a) {
if (a.size()) {
a[0] = toupper(a[0]);
}
}
void foo(string& a, string& b, string& c, string& s) {
caps(a);
caps(b);
caps(c);
for (int i = 0; i < b.size(); i++)
{
s.push_back(b[i]);
}
s.push_back(' ');
s.push_back(a[0]);
s.push_back('.');
s.push_back(c[0]);
s.push_back('.');
}
int main()
{
string s;
string a;//name
string b;//surname
string c;//otchectvo
cin >> b >> a >> c;
foo(a, b, c, s);
cout << s;
}
Editor is loading...
Leave a Comment