Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Dare un messaggio per dire se in una stringa sono presenti caratteri numerici#include<iostream>
- #include <string>
- using namespace std;
- void ins(string &s);
- main()
- {
- string s;
- int a;
- ins(s,a);
- }
- void ins(string &s)
- {
- cout<<"inserisci una parola ";
- cin>>s;
- }
- void lunghezza(string s, int &a)
- {
- a=s.length();
- cout<<"la parola"<<s<<"e' composta da "<<a<<" lettere"<<endl;
- }
- void numerici(string s, int a)
- {
- bool t;
- for(int i=0 ; i<a ; i++)
- {
- if(s[i] > 0 || s[i]< 9)
- {
- t=true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement