Professional Documents
Culture Documents
324 Omar Lab 1
324 Omar Lab 1
Lab Report: 01
Course Title:Compiler Design Lab
Course Code: CSE-324
Submitted By Submitted To
Name: Md. Saddam Hossain.
Name: Omar Farque Assistant Professor
Department of CSE BUBT
ID: 22234103118
Intake:50
Section:3
Department of CSE
Date:10-01-2024
Signature of the instructor
…………………………...
Problem no 01:
Split the words into meaningfull token based on different types of delimetery.
Sample input:
I love my contry $very; much.
Sample output:
I Love my contry very much.
Code:
#include <iostream>
#include <string>
#include <vector>
if (!token.empty()) {
tokens.push_back(token);
}
return tokens;
}
int main() {
std::string sentence;
getline(std::cin, sentence);
return 0;
}
Output:
Conclusion: The C++ code effectively removes white spaces from a user-input sentence and
outputs the modified sentence along with the count of removed white spaces.