im going to write a small program where the user types in a email adress and the code have to check if the email includes a @: ive just started programing and this is what ive come up with so far:
#include <iostream>
#include <string>
using namespace std;
int main() {
cout << "Skriv in en Epostadress: \n";
string adress;
cin >> adress;
if (adress == "@"){
cout << "Giltig!";
}
else {
cout << "Ogiltig!";
}
return 0;
}
Aucun commentaire:
Enregistrer un commentaire