필터 지우기
필터 지우기

Write a program to input 3 integer digits (from 100 - 999), then in the numbers letters in hundreds, tens, and units ?

조회 수: 9 (최근 30일)
I need help
  댓글 수: 2
Minh
Minh 2022년 9월 21일
편집: Minh 2022년 9월 21일
Can you convert this c++ code to matlab for me?
void main ()
{
int x;
do
{
printf ( "\ nx =" );
scanf ( "% d" , & x);
}
while (x <100 || x> 999);
printf ( "\ n hundreds :% d" , x, x / 100);
printf ( "\ n tens :% d" , x, (x% 100) / 10);
printf ( "\ n units :% d" , x, (x% 100)% 10);
getch ();

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2022년 9월 21일
  댓글 수: 1
Minh
Minh 2022년 9월 21일
I can't convert when reading this document, can you give more instructions ?
void main()
{
int x;
do
{
printf("\n x = ");
scanf("%d", &x);
}
while(x < 100 || x > 999 );
printf("\n hundreds : %d", x, x/100);
printf("\n tens: %d", x, (x%100)/10);
printf("\n units: %d", x, (x%100)%10);
getch();
}

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by