Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int kalimatAkhir;
- string kalimat;
- cout << "Masukkan kalimat : "; getline(cin, kalimat);
- kalimatAkhir = kalimat.length();
- cout << "\nHuruf pertama : " << kalimat[0];
- cout << "\nHuruf terakhir : " << kalimat[kalimatAkhir-1];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement