Skip to content

Instantly share code, notes, and snippets.

@DavidePastore
Created October 25, 2013 21:02
Show Gist options
  • Save DavidePastore/7161803 to your computer and use it in GitHub Desktop.
Save DavidePastore/7161803 to your computer and use it in GitHub Desktop.
Cosa produce il seguente codice c++?
#include <iostream>
using namespace std;
int main(){
int x,w;
cin>>x;
if (x==0)
{
w=1;
}
else
{
w=0;
do
{
w++;
x=x/10;
}while(x>0);
}
cout<<"****** W = "<<w;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment