Ispit.cpp Apr 2026

The problem represented by ispit.cpp (likely "ispit" meaning "exam" in Croatian/Serbian/Bosnian) is a common competitive programming task from the . The goal of this specific program is to generate an acronym or short identification string from a multi-word input string by extracting the first letter of each word and converting it to uppercase. Problem Overview: Acronym Generation

biti ali i ne biti → Output: BNB (Note: Single-letter words like 'i' are typically treated as full words depending on the specific problem constraints). Input: ali ja sam i jucer jeo → Output: AJSJJ Procedural Implementation Steps ispit.cpp

#include #include #include using namespace std; int main() string s; getline(cin, s); // Output first character if(s.length() > 0) cout << (char)toupper(s[0]); // Look for spaces to find the start of the next words for(int i = 0; i < s.length(); i++) s[i] == ' ') if(i + 1 < s.length()) cout << (char)toupper(s[i+1]); cout << endl; return 0; Use code with caution. Copied to clipboard The problem represented by ispit

The program reads a line of text containing multiple words and outputs a single string where each character represents the starting letter of a word in the original input. Input: mirko soft → Output: MS Input: ali ja sam i jucer jeo →

Since the input contains spaces, std::getline is necessary to capture the full string. std::string input; std::getline(std::cin, input); Use code with caution. Copied to clipboard

The very first character of the string (if it exists and is not a space) is always part of the result.