Dyskusje Q&A
Print() or return()?
1 Głos
2 odpowiedzi#include <iostream>
#include <bitset>
int main()
{
int myDecimalNumber;
std::cin >> myDecimalNumber;
std::string binary = std::bitset<8>(myDecimalNumber).to_string(); //to binary
std::cout<<binary<<"\n";
unsigned long decimal = std::bitset<8>(binary).to_long();
std::cout<<decimal<<"\n";
return 0;
}
2 głosów
5 odpowiedziDef не печатается без принт
0 głosów
1 Odpowiedźwhy this code is not working
0 głosów
1 OdpowiedźРазжуйте модуль "методы"
0 głosów
3 odpowiedziC#Love Chat-6
4 głosów
6 odpowiedzican someone please explain why this code keeps telling me complication error instead of outputting the value of speed.
#include <iostream>
using namespace std;
class myClass {
public:
void setcarspeed (int a){
speed=a;
}
int getcarspeed(){
return speed;
}
private:
int speed;
};
int main() {
myClass obj;
obj.setcarspeed (40);
cout<<obj.getcarspeed ;
return 0;
}
2 głosów
3 odpowiedzi3 guesses
0 głosów
1 OdpowiedźPopularne dzisiaj
Functions in python
2 Votes
How to make a playground
1 Votes
For Mobile app
0 Votes
I need advice
0 Votes
Html 5 document question
1 Votes
Paint costs
1 Votes
Learning Python - Question
1 Votes